[Editor] AMXXPawn for Visual Studio Code
AMXXPawn Language Service for VSCode An extension for Visual Studio Code that adds support for the AMXXPawn language. Features Right now this is pretty much an early preview/beta version with features lacking, and some features even not working properly. Even though it's unfinished, I've posted this solely to get feedback. I encourage you to post in this topic and help me improve this extension. However, here is a basic preview of currently implemented features:
Visual Studio Code In case you haven't heart of Visual Studio Code (VSCode) yet - it's an open-source multiplatform text/code editor developed and maintained by Microsoft. It's entirely written in TypeScript using Electron framework. It has many great built-in features like Git integration and Debugging support, but also has support for extensions (just like this one), of which there are many. VSCode has been my go-to editor for many other languages (especially for Node.js development) for a while now, but it never had proper Pawn support. This extension aims at improving Pawn language support in VSCode. Official site & Downloads Installation Instructions Installation is pretty straightforward, thanks to VSCode's great support for extensions. All you have to do is to open the Extensions View (by using the bar on the left hand side or pressing Ctrl+Shift+X), search for "amxxpawn" and click the "Install" button, then reload VSCode. Make sure to install the one with my name as there are two registered amxxpawn extensions. https://image.prntscr.com/image/unHa...8QmNbx3oCA.png Source Code Change Log Contributions are welcome. Also, if you have any ideas/suggestions/critiques, please post in this topic. TODO: Code:
|
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
nice, i have a suggestion can you add an option like "Compile plugin" called "Compile plugin local" so it search amxxpc.exe where the .sma folder.
|
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Quote:
|
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
a command, its not strange its usefull just one press this command it looks for amxxpc.exe or compile.exe in the opened file folder.
|
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
I've pushed an update for your request. You can update your extension by going to the Extensions View and clicking the "Update" button on the extension entry.
|
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
if possible also check for include folder ect..., like when you open a sma in amxmodx/scripting/ you get evry thing in that folder.
|
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Version 0.2.0 has been published, you can install/update it from the Extensions View, as usual.
Code:
[Version 0.2.0] - 2017-08-25 https://image.prntscr.com/image/aG7O...P5Z1YWWuMw.png Document symbol lookup: https://image.prntscr.com/image/uN79...MyCUybXbfQ.png |
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Good job. Can you make project directory variable for compiler paths?
|
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Quote:
|
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
KliPPy,
I mean support of relative paths or special variable for project directory. For example: PHP Code:
PHP Code:
|
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
can you add somthing like this :
PHP Code:
PHP Code:
|
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Quote:
So in VSCode there are two contexts: workspace (which only exists if a folder is opened) and currently opened file. There are THESE substitution variables available, but they are only available within tasks.json, so that doesn't help us here as they are not resolved/expanded within settings. There is some talk HERE to support it in settings.json (which can be overriden per-workspace) but it hasn't been implemented yet, nor do extensions have a service to resolve those substitution variables. I can write a substitution variables resolver I guess, but keep reading this post, what I am about to write may help you. Quote:
Also, here is another (and probably better) solution - why not create a BUILD TASK in .vscode/tasks.json for your workspace? Here's a working example: Code:
{ |
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
ok thank build task is what i need.
|
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Is there something like this for Visual Studio (full version)?
|
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Quote:
|
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
KliPPy
Yes, I'm talking about an opened folder. I know about workspace configs, but anyway I should write absolute path for include directory, so, yep, relative path will be nice. |
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Quote:
If you absolutely need it the way you want it, then I guess I can write a substitution variables resolver. |
Re: [Editor?] AMXXPawn Language Service for Visual Studio Code
Published version 0.2.1.
Code:
## [Version 0.2.1] - 2017-08-27 |
Re: [Editor] AMXXPawn for Visual Studio Code
KliPPy
I need autocomplete, not a compiler. |
Re: [Editor] AMXXPawn for Visual Studio Code
Quote:
|
Re: [Editor] AMXXPawn for Visual Studio Code
Alright, there's a new update.
amxxpawn.compiler.executablePath, amxxpawn.compiler.includePaths and amxxpawn.compiler.outputPath now support variable substitution. You can use the same ones that are defined HERE except ${cwd} and ${lineNumber}. Is that what you needed? Here's a full changelog: Code:
## [Version 0.3.0] - 2017-08-27 |
Re: [Editor] AMXXPawn for Visual Studio Code
1 Attachment(s)
KliPPy
Works for compiler, but doesn't work for include. PHP Code:
|
Re: [Editor] AMXXPawn for Visual Studio Code
Aye, totally forgot about the parser. I've pushed an update, should be good now. Keep in mind that includePaths will only support ${workspaceRoot} and ${workspaceRootFolderName} (and any future workspace variables), as the language server has no knowledge of what file is currently open/focused.
Code:
## [Version 0.3.1] - 2017-08-27 |
Re: [Editor] AMXXPawn for Visual Studio Code
KliPPy
It works, thanks. I use "Ctrl + Mouse Click" to go to definition, but it opens documentation after click, can you add option to disable this? |
Re: [Editor] AMXXPawn for Visual Studio Code
You can use F12 to go to or Alt+F12 to peek definition too. But yeah, I don't like that links and definitions are "clashing" either, I've been thinking a about a solution to that.
I guess I can add a setting in the next update, but I won't be pushing an update for that feature only. I hope you can live with it for a day or two. Anyway, what are your overall thoughts? You've provided a great deal of feedback already and thank you for that. :^) |
Re: [Editor] AMXXPawn for Visual Studio Code
Quote:
Quote:
Quote:
Also I wrote simple plugin for gulp to compile sma and I using it in my project, so now I need only autocompletion. :) https://www.npmjs.com/package/gulp-sma
P.S
|
Re: [Editor] AMXXPawn for Visual Studio Code
Can we disable this messages? Its using so much space. Thank you.
http://i.imgur.com/s9DhHvs.png |
Re: [Editor] AMXXPawn for Visual Studio Code
Quote:
|
Re: [Editor] AMXXPawn for Visual Studio Code
Quote:
http://i.imgur.com/fArRHWS.png Also, is that possible to highlight warnings/errors right in code window? Like in sublime text: http://i.imgur.com/1WE6pXw.png |
Re: [Editor] AMXXPawn for Visual Studio Code
Quote:
Quote:
|
Re: [Editor] AMXXPawn for Visual Studio Code
Quote:
|
Re: [Editor] AMXXPawn for Visual Studio Code
Quote:
And maybe Ctrl + Click :arrow: Ctrl + Left Click |
Re: [Editor] AMXXPawn for Visual Studio Code
Quote:
Quote:
|
Re: [Editor] AMXXPawn for Visual Studio Code
An update has been published.
Code:
## [Version 0.4.0] - 2017-08-29 https://image.prntscr.com/image/aYho...cfmNYwPryw.png |
Re: [Editor] AMXXPawn for Visual Studio Code
https://pp.userapi.com/c638329/v6383...ECrf4rLp0w.jpg
With the syntax highlighting on STATUSICON_HIDE something is not right |
Re: [Editor] AMXXPawn for Visual Studio Code
STATUSICON_HIDE is fine, STATUSICON_SHOW isn't. It's because highlight is picking up "STATUSICON_SHOW :" as a tag. There's really no reliable way to match Pawn tags with regex only, and language server protocol doesn't allow me to dynamically add decorations to code.
As far as I've seen no other editor provided highlight for tags and I see why - the syntax is so stupid it's not possible (at least not reliably). Do I leave it as it is or just remove highlight for tags completely? |
Re: [Editor] AMXXPawn for Visual Studio Code
I have some suggestions, if its possible, of course:
1. For functions that have arguments, show hint with arguments by clicking on function name:
http://i.imgur.com/NADQU1z.png 4. May be pointless as hard to implement, but anyway. Show lang file string value on hover by lang key: http://i.imgur.com/v12Kz80.png |
Re: [Editor] AMXXPawn for Visual Studio Code
Quote:
|
Re: [Editor] AMXXPawn for Visual Studio Code
So in Ternary Boolean you need to remove the syntax highlighting.
Or find a competent way to determine the ternary operation and the declared type inside it. |
Re: [Editor] AMXXPawn for Visual Studio Code
Quote:
Quote:
Quote:
Quote:
Quote:
Thanks for your input. Have some :bacon!: :bacon!: :bacon!: Quote:
|
All times are GMT -4. The time now is 13:01. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.