Git Product home page Git Product logo

spcode's People

Contributors

arkarr avatar bara avatar bara20 avatar haytsir avatar hexer10 avatar js6pak avatar julienkluge avatar maxijabase avatar milutinke avatar muinez avatar nachtfrische avatar natanel-shitrit avatar necavi avatar psychonic avatar punteroo avatar quantum-o avatar reinakumiko avatar shahriyarb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spcode's Issues

Multi-line select edit issues

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.

After reformatting syntax, cursor goes to the bottom

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.

Replace Lysis with web-based version.

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.

Editor immediately crashes after clicking

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

[Bug] Unexpected crash after opening and closing the 'Edit Configurations' window

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:

spcode-default-install

Here is the bug occurring after changing the SP default installation path:

spcode-changed-install1

Crashing after `=` sign

Its frequently crashing when I try to type "something = " without having a ; at the end of the line already

IDE is always on the secondary monitor

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.

Enclose selection instead of replace

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 [] {} () "" ''.

Auto check current scripting folder for includes???

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

[Bug] Apostrophe (Single Quote) character causes include files to be parsed incorrectly.

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):
L311-L338

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:
image

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:
image

To fix this i removed the apostrophe character in line 327, in the #pragma (that's a "comment", providing additional information to the compiler).

image

After force closing SPcode, now the natives below work normally as should be:
image

Thanks you for this awesome program and i hope this will help fix this problem.

[Bug] Custom scripting directories don't work properly

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.

Indentation issue

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.

Colouring

You can add colouring methodmap "Function".

IDE Should be aware of the types

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.

errors

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

Methodmap tooltip

Right now the IDE finds the methodmap declaration from the current file, which doesn't check for the current level.

Allow disabling Discord Rich Presence

My one gripe with this fork is that there is no way to disable the Discord Rich Presence.

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.

[Bug] 'File' translation problem

REQUIRE_PLUGIN doesn't appear in purple (by default) anymore

Translation "File" for the first menu doesn't work, and still displays "File" even though I set language to french

SPEdit:
image

SPCode:
image

IDE fps problem

When i turn on Dynamic Autocompletition/Intellisense IDE seems like 10 fps. I turn off this feature and it turn back to normal fps

Crashes on save if not defined

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;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.