spcodeorg / spcode Goto Github PK
View Code? Open in Web Editor NEWA lightweight SourcePawn editor.
Home Page: https://forums.alliedmods.net/showthread.php?p=2693577
A lightweight SourcePawn editor.
Home Page: https://forums.alliedmods.net/showthread.php?p=2693577
Crash Log: https://pastebin.com/83ZTmqUV
When using the alt left-click to select and edit multiple lines, putting "[" "{" etc with auto-close on only auto-closes the first selected line. Trying to delete in multiple lines also only deletes the first selected line. Also it sometimes brings the page up to the top when editing.
Pressing CTRL+R to reformat syntax sends the text cursor to the bottom of the document and as soon as I want to press the arrow keys to navigate through the piece of code I'm looking at, it takes me completely out of my scope by scrolling to the bottom.
The current implementation of lysis, used by SPCode, hasn't been updated since 2012, a all of the newer plugins cannot be decompiled with it. A solution could be to use a 3rd party service like https://headlinedev.xyz/lysis/
or even implement a Java interface with the latest Lysis Java implementation.
Stack Trace:
1
Section: SPCODE MAIN
.NET Version: 4.0.30319.42000
OS: Microsoft Windows NT 6.2.9200.0
64 bit OS: TRUE
64 bit mode: TRUE
Dir: C:\Users\Mikusch\AppData\Roaming\spcode
Working Set: 173116 kb
Installed UI Culture: en-US
Current UI Culture: en-GB
Current Culture: en-DE
Exception 1
Message:
parsing "\bADMFLAG_BAN\b|\bADMFLAG_CHANGEMAP\b|\bADMFLAG_CHAT\b|\bADMFLAG_CHEATS\b|\bADMFLAG_CONFIG\b|\bADMFLAG_CONVARS\b|\bADMFLAG_CUSTOM1\b|\bADMFLAG_CUSTOM2\b|\bADMFLAG_CUSTOM3\b|\bADMFLAG_CUSTOM4\b|\bADMFLAG_CUSTOM5\b|\bADMFLAG_CUSTOM6\b|\bADMFLAG_GENERIC\b|\bADMFLAG_KICK\b|\bADMFLAG_PASSWORD\b|\bADMFLAG_RCON\b|\bADMFLAG_RESERVATION\b|\bADMFLAG_ROOT\b|\bADMFLAG_SLAY\b|\bADMFLAG_UNBAN\b|\bADMFLAG_VOTE\b|\bADMINMENU_PLAYERCOMMANDS\b|\bADMINMENU_SERVERCOMMANDS\b|\bADMINMENU_VOTINGCOMMANDS\b|\bALL_VISIBLE_CONTENTS\b|\bATTACHMENTPOLICY_MODEL\b|\bAUTHMETHOD_IP\b|\bAUTHMETHOD_NAME\b|\bAUTHMETHOD_STEAM\b|\bAVERAGE_JUMPTIME\b|\bAdminFlags_TOTAL\b|\bBANFLAG_AUTHID\b|\bBANFLAG_AUTO\b|\bBANFLAG_IP\b|\bBANFLAG_NOKICK\b|\bCINIT(%1,%2,%3)\b|\bCOLOR_ALICEBLUE\b|\bCOLOR_ALLIES\b|\bCOLOR_ANCIENT\b|\bCOLOR_ANTIQUEWHITE\b|\bCOLOR_AQUA\b|\bCOLOR_AQUAMARINE\b|\bCOLOR_ARCANA\b|\bCOLOR_AXIS\b|\bCOLOR_AZURE\b|\bCOLOR_BEIGE\b|\bCOLOR_BISQUE\b|\bCOLOR_BLACK\b|\bCOLOR_BLANCHEDALMOND\b|\bCOLOR_BLUEVIOLET\b|\bCOLOR_BROWN\b|\bCOLOR_BURLYWOOD..." - Not enough )'s.
Stacktrace:
at System.Text.RegularExpressions.RegexParser.ScanRegex()
at System.Text.RegularExpressions.RegexParser.Parse(String re, RegexOptions op)
at System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options, TimeSpan matchTimeout, Boolean useCache)
at System.Text.RegularExpressions.Regex..ctor(String pattern)
at SPCode.UI.Components.AeonEditorHighlighting.get_MainRuleSet()
at ICSharpCode.AvalonEdit.Highlighting.DocumentHighlighter..ctor(TextDocument document, IHighlightingDefinition definition)
at ICSharpCode.AvalonEdit.Highlighting.HighlightingColorizer.CreateHighlighter(TextView textView, TextDocument document)
at ICSharpCode.AvalonEdit.Highlighting.HighlightingColorizer.RegisterServices(TextView textView)
at ICSharpCode.AvalonEdit.Rendering.TextView.LineTransformer_Added(IVisualLineTransformer lineTransformer)
at ICSharpCode.AvalonEdit.Utils.ObserveAddRemoveCollection`1.InsertItem(Int32 index, T item)
at ICSharpCode.AvalonEdit.TextEditor.OnSyntaxHighlightingChanged(IHighlightingDefinition newValue)
at ICSharpCode.AvalonEdit.TextEditor.OnSyntaxHighlightingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at SPCode.UI.Components.EditorElement.Caret_PositionChanged(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at ICSharpCode.AvalonEdit.Editing.Caret.RaisePositionChanged()
at ICSharpCode.AvalonEdit.Editing.Caret.set_Position(TextViewPosition value)
at ICSharpCode.AvalonEdit.Editing.SelectionMouseHandler.SetCaretOffsetToMousePosition(MouseEventArgs e, ISegment allowedSegment)
at ICSharpCode.AvalonEdit.Editing.SelectionMouseHandler.textArea_MouseLeftButtonDown(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at SPCode.Program.Main(String[] args)
Source:
System
HResult Code:
-2147024809
Helplink:
null
Targetsite Name:
ScanRegex
SPCode Version: 1.6.2.1
An unexpected crash can consistently occur if you open and then close 'Edit Configurations' window. This only happens if the installation path for SPCode was changed from the default path %APPDATA%/Roaming/spcode
. When this crash occurs, no error or crash logs are generated
Here the bug does not occur on the default installation path:
Here is the bug occurring after changing the SP default installation path:
Its frequently crashing when I try to type "something = " without having a ; at the end of the line already
SPCode never starts in my primary monitor, I have tried minimizing -> move to primary -> maximizing -> exit to save the window position but it still opens in the secondary monitor. Not sure if this is present in SPEdit. Just inconvenient having to always move it.
I think that the autocomplete (and IntelliSense) should work even for user defined variable in the current file.
duplicated post closing
Feature request: when auto close is enabled (or have a toggle option) and a text is selected enclose it instead of replacing it.
Example: public void OnPluginStart
() becomes public void "OnPluginStart"() instead of public void ""()
Same goes with [] {} () "" ''.
I think by default Spcode looks in its own data folder for includes if I make a scripting folder somewhere else on my drive C:/scripting
for example and put all my custom plugins in here so I can seperate them from the default sourcemod plugins the current folder should have the option of being added to the scripting directory
Here's a example: https://i.imgur.com/clIMbIL.gif
Probably it takes the bracket from "if ()" as his closing bracket.
There should be an option with which should be formatted.
Note: This is the latest version of the standalone version, not tested on the installer version but expected to be the same.
If apostrophe character ('
) is used in an include file, some of the natives are not getting parsed, hence not presented in the autocomplete suggestions.
Not parsed natives compiles normally when used in plugins because it has nothing to do with lysisthe compiler.
Example:
Default halflife.inc
file (Lines 311 - 338):
You can see the color of PrecacheSound()
, which is light blue that indicates that it's a defined native
.
Hence, it will show the definition when clicked inside the parentheses:
Unlike the example above, CreateDialog()
, that should be treated same, is colored in a darker blue (that indicates a normal function, not sure, probably.) and does not open the definition when clicked inside the parentheses:
To fix this i removed the apostrophe character in line 327, in the #pragma
(that's a "comment", providing additional information to the compiler).
After force closing SPcode, now the natives below work normally as should be:
Thanks you for this awesome program and i hope this will help fix this problem.
When you drag the window, a white screen appears. After the window has been put down code disappears.
https://gyazo.com/40aae66f116c97fb20974952cbaf9441
Probably stupid to use the Name string to check for them, but there actually isn't any other thing that identify them as unique - might be totally wrong, though.
Apparently, for the IDE to compile plugins that have stuff that are in custom defined scripting directories, they must be pointing directly to the folder that has all (or the) .inc
files, BUT this renders Go To Definition (CTRL+CLICK) unusable.
.\sourcepawn\configs\sm_1_10_0_6478;C:\spcodecomp\customconfigs\include
Furthermore, if you don't specify an include folder, and just point to the folder that HAS the include (just like the stock folder), Go To Definition WILL work, but plugin will not compile at all - it will spit that the custom include used there is missing (cannot read from file "include"
)
.\sourcepawn\configs\sm_1_10_0_6478;C:\spcodecomp\customconfigs
One COULD delete the part in the PathBuilder where the word "include" is added:
// First search across all scripting directories
var sm = MatchDefinition(Program.Configs[Program.SelectedConfig].GetSMDef(), word, e);
if (sm != null)
{
var config = Program.Configs[Program.SelectedConfig].SMDirectories;
foreach (var cfg in config)
{
var file = Path.GetFullPath(Path.Combine(cfg, /*"include",*/ sm.File)) + ".inc"; // <------- here
await Task.Delay(100);
var result = Program.MainWindow.TryLoadSourceFile(file, true, false, true);
if (!result)
{
Debug.Print($"File {file} not found!");
continue;
}
var newEditor = Program.MainWindow.GetCurrentEditorElement();
Debug.Assert(newEditor != null);
newEditor.editor.TextArea.Caret.Offset = sm.Index;
newEditor.editor.TextArea.Caret.BringCaretToView();
newEditor.editor.TextArea.Selection = Selection.Create(newEditor.editor.TextArea, sm.Index, sm.Index + sm.Length);
return;
}
}
BUT, although this enables custom directories to both be valid for compiling and apprearing in autocompletion, breaks the stock SM includes folder. This is because now, you must specify \include
in all SM directores you set in the config - if you do that in the stock config, the program loses track of spcompiler.exe
, effectively breaking compilation.
.\sourcepawn\configs\sm_1_10_0_6478\include;C:\spcodecomp\customconfigs\include
One of the possible outcomes would be rethinking of where the program stores and utilizes the SP compiler, but I hope to be wrong, luckily someone else than me might give it a look and come up with a less invasive solution, who knows.
I don't like how the current indentation for the block is handled, but right now I don't know how to do it properly.
I prove this by uploading, reloading a plugin and checking it's hash - every time it gets renewed until I check that box.
Same as in the title
https://gyazo.com/2e1d0bfef8f9356d8a8752781e4726d0
You can add colouring methodmap "Function".
Originally from @rlevet
SPEdit:
Will add that this happens also with REQUIRE_EXTENSIONS
- shared similarity with REQUIRE_PLUGIN
is that they are, as I can describe it, preprocessor directives that do not have a "value", therefore they do not get highlighted as such.
Opening an .smx and attempting to close it crashes the program.
CRASH_22378890.txt
Right now the IDE doesn't know the type of each variable and where it is defined, doing this would improve the IntelliSense for method maps, and it is required for enum struct auto complete.
Installed through the 1.3.6.2 installer, although version says 1.3.6.1
could be per color block, or in general
Hello, i do not know if it's a bug, but with a default 1.10 spcompiler, i don't see any errors in SPCode. Normal compile.exe says there's an error, but nothing shows up in IDE. It's propably my fault, but i would be happy, if someone would help me. Regards
Right now the IDE finds the methodmap declaration from the current file, which doesn't check for the current level.
I don't want everyone on Discord to be able to see what I'm editing.
Solution: Add a simple toggle to the options menu to disable Rich Presence.
Version is the "portable" latest version (1.3.5.0)
Crash dump: https://pastebin.com/uiwNxu04
would be useful to configure a directory selector at the bottom right filled with all specified scripting directories to browse
FTP is so back in the day and plaintext transfer method maybe we could get Secure FTP or SSH?
When i turn on Dynamic Autocompletition/Intellisense IDE seems like 10 fps. I turn off this feature and it turn back to normal fps
Simply,
public Action Event_PlayerHurt(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
int attacker = GetClientOfUserId(event.GetInt("attacker"));
int health = event.GetInt("health");
int damageDone =
}
Crashes SPCode because int has not been defined. Happened when restarting after the laptops battery was drained. So it saved like that, and it would crash whenever I opened SPCode.
So solving the crash was:
public Action Event_PlayerHurt(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
int attacker = GetClientOfUserId(event.GetInt("attacker"));
int health = event.GetInt("health");
int damageDone = 0;
}
My settings:
https://i.imgur.com/YL4dp4s.png
Here's a gif as example what I mean:
https://i.imgur.com/xJRZ4K5.gif
Plus, it wasn't updating the SPCode program title from the file path to clean title.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.