Raised This Month: $12 Target: $400
 3% 

[Editor] AMXXPawn for Visual Studio Code


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-25-2021 , 21:27   Re: [Editor] AMXXPawn for Visual Studio Code
Reply With Quote #171

Quote:
Originally Posted by Abhinash View Post
The latest version of this extension doesn't work with the latest version of VS Code.
Because when you click on Compile Plugin or Compile Plugin Locally, it will always give an error "command amxxpawn.compile not found".
I searched through stackoverflow and found that you need to activate the commands on "activation events" section in the "package.json" file and then recompile it.
After recompiling, it works fine as it is expected.
Klippy please update the extension by doing the following fixes, else if no one is going to do these, then I might publish the fixed version in the market place.
I opened the project and ran it in debug mode successfully without any changes. It already has an activation event listed in package.json.

Can you provide what you changed to make it work for you? What version of VSCode are you using? Are on on Windows or Linux?
__________________

Last edited by fysiks; 08-25-2021 at 21:28.
fysiks is online now
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 09-04-2021 , 12:56   Re: [Editor] AMXXPawn for Visual Studio Code
Reply With Quote #172

The problem is actually with the new version of VS Code in Windows.
The things which I changed are --

Changed this part --
Code:
"activationEvents": [
        "onLanguage:amxxpawn"
To --
Code:
"activationEvents": [
        "onLanguage:amxxpawn",
        "onCommand:amxxpawn.compile",
        "onCommand:amxxpawn.compileLocal"
After that I was unable to compile the plugin with npm, so I changed the the dev dependency to this then it compiled and ran properly as expected.

Changed this part --
Code:
"devDependencies": {
        "@types/node": "^6.0.40",
        "typescript": "^2.0.3",
        "vscode": "^1.1.10"
To this --
Code:
"devDependencies": {
        "@types/node": "^6.0.40",
        "typescript": "^2.0.3",
        "vscode": "^1.1.37"
Abhinash is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-04-2021 , 22:42   Re: [Editor] AMXXPawn for Visual Studio Code
Reply With Quote #173

I tried to reproduce the error that you are seeing on a Windows 10 VM with vscode 1.60.0 and I never get the missing command error.

Also, after learning a bit about vscode extensions and how they work, the only way for you to have the issue is if the file wasn't properly recognized as using the amxxpawn language. As soon as the file is recognized as or set to use amxxpawn then the extension will get activated and register those commands. Note: The activation events is for activating the extension (including commands), not the individual commands themselves.

In summary, I suspect that your file might not be properly set to the amxxpawn language.
__________________

Last edited by fysiks; 09-04-2021 at 23:07.
fysiks is online now
hellmoss
Senior Member
Join Date: Oct 2009
Location: ZOMBIE PLAGUE
Old 09-06-2021 , 12:31   Re: [Editor] AMXXPawn for Visual Studio Code
Reply With Quote #174

This solved my problem, thanks @Abhinash!
__________________
Quote:
Originally Posted by Kakarot47 View Post
There is no bug. with 100% gurenty

Last edited by hellmoss; 09-06-2021 at 12:31.
hellmoss is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-06-2021 , 15:01   Re: [Editor] AMXXPawn for Visual Studio Code
Reply With Quote #175

Quote:
Originally Posted by hellmoss View Post
This solved my problem, thanks @Abhinash!
I'm really curious about the root cause of the original issue. When you were having the issue, was your file properly recognized as being AMXXPawn? I.e. is showed "AMXXPawn" as the language in the bottom right of the window?

What version of Windows are you running? What version of vscode are you running?
__________________
fysiks is online now
phayzee
New Member
Join Date: Sep 2021
Old 09-06-2021 , 17:37   Re: [Editor] AMXXPawn for Visual Studio Code
Reply With Quote #176

I get this error when trying to compile any plugin with VS Code:
HTML Code:
Failed to start amxxpc: spawn X:\MyPrograms\Steam\steamapps\common\Half-Life\cstrike\addons\amxmodx\scripting ENOENT
I'm using the latest version of of VS Code, on Windows.
Using the terminal I'm able to compile files just fine, I have no idea why it's not working through VS Code.

The compiler and include path should be fine:
PHP Code:
    "amxxpawn.compiler.includePaths": [
        
"X:\\MyPrograms\\Steam\\steamapps\\common\\Half-Life\\cstrike\\addons\\amxmodx\\scripting\\include",
        
"X:\\MyPrograms\\Steam\\steamapps\\common\\Half-Life\\cstrike\\addons\\amxmodx\\scripting\\include\\amxmod_compat"    
    
], 
PHP Code:
    "amxxpawn.compiler.executablePath""X:\\MyPrograms\\Steam\\steamapps\\common\\Half-Life\\cstrike\\addons\\amxmodx\\scripting"
Any insights into this?
phayzee is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-06-2021 , 20:17   Re: [Editor] AMXXPawn for Visual Studio Code
Reply With Quote #177

The executablePath needs to include the executable itself. So, on Windows, it would need to end with "amxxpc.exe". So, your full path should be:

X:\MyPrograms\Steam\steamapps\common\Half-Life\cstrike\addons\amxmodx\scripting\amxxpc. exe

If you manually edit the JSON file directly, you need to escape the backslashes (i.e. \\).
__________________
fysiks is online now
phayzee
New Member
Join Date: Sep 2021
Old 09-07-2021 , 07:00   Re: [Editor] AMXXPawn for Visual Studio Code
Reply With Quote #178

Alright, that solved. Thanks!

I thought it was supposed to find the .exe itself looking in the path that I mentioned. Not that I needed the exact path to the compiler. But anyways
phayzee is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-07-2021 , 21:31   Re: [Editor] AMXXPawn for Visual Studio Code
Reply With Quote #179

Quote:
Originally Posted by phayzee View Post
Alright, that solved. Thanks!

I thought it was supposed to find the .exe itself looking in the path that I mentioned. Not that I needed the exact path to the compiler. But anyways
When I first started using it, I did the exact same thing (not including the executable) because it wasn't entirely clear that you needed to include it. You are not alone.
__________________

Last edited by fysiks; 09-07-2021 at 21:31.
fysiks is online now
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 09-07-2021 , 21:44   Re: [Editor] AMXXPawn for Visual Studio Code
Reply With Quote #180

Quote:
Originally Posted by fysiks View Post
I tried to reproduce the error that you are seeing on a Windows 10 VM with vscode 1.60.0 and I never get the missing command error.

Also, after learning a bit about vscode extensions and how they work, the only way for you to have the issue is if the file wasn't properly recognized as using the amxxpawn language. As soon as the file is recognized as or set to use amxxpawn then the extension will get activated and register those commands. Note: The activation events is for activating the extension (including commands), not the individual commands themselves.

In summary, I suspect that your file might not be properly set to the amxxpawn language.
In my case the file was properly detected and also the Syntax Highlighting worked but not the compile functions. So I did few changes which I mentioned above and it worked.
Abhinash is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode