Coder Social home page Coder Social logo

armitxes / vscode_sqf Goto Github PK

View Code? Open in Web Editor NEW
47.0 10.0 29.0 4.35 MB

Visual Studio Code ~ SQF Language plugin

Home Page: https://armitxes.net/Projects/VSCodeSQF/

License: Other

Python 100.00%
sqf-language development sqf scripting editor visual-studio-code linux mac windows

vscode_sqf's Introduction

SQF Language

This extension integrates the SQF Language into Visual Studio Code. For more information please visit the wiki.

Supported Products

  • Operation Flashpoint [OFP & OFP Resistance]
  • Take On Helicopters [ToH]
    • Enable/Disable commands from ToH via "sqf.enableTOH". Default: disabled
    • Wiki: ToH Commands
  • Armed Assault [ArmA]
    • Enable/Disable commands from ArmA via "sqf.enableARMA". Default: enabled (needed for all futher ArmA versions)
    • Wiki: ArmA Commands
  • Armed Assault 2 & Operation Arrowhead [ArmA 2 & ArmA 2: OA]
  • Armed Assault 3 [ArmA 3]
    • Enable/Disable commands from ArmA 3 via "sqf.enableARMA3". Default: enabled (needed for all futher ArmA versions)
    • Wiki: ArmA 3 Commands
  • Community Based Addons [CBA]
    • Enable/Disable commands from CBA via "sqf.enableCBA". Default: disabled
    • Wiki: CBA GitHub
    • Contributors: bux
  • ACE 3 [CBA]
    • Enable/Disable commands from ACE3 via "sqf.enableACE3". Default: disabled
    • Wiki: ACE3
    • Contributors: bux

Manual Installation

Use this guide if the installation over the marketplace isn't possible.

  • Download VS Code & the master.zip.

  • Install Visual Studio Code.

  • Navigate to your VS Code extensions folder.

    • Windows: %USERPROFILE%/.vscode/extensions.
    • Mac/Linux: $HOME/.vscode/extensions.
  • In the extensions folder, you create a folder called Armitxes.SQF.

  • Extract the master.zip inside the Armitxes.SQF folder.

Links & Downloads

vscode_sqf's People

Contributors

armitxes avatar connorau avatar willwaywell 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode_sqf's Issues

Variables assigned from predicated counts highlighted as functions

They should be variables, not functions. Consider:

private _sectorCount = {
  (markerPos _x distance _estimatedPos) < KPLIB_logistics_incidentWindow_distance
} count _opforSectors;

Sees the curly braces {...} and assumes function. As contrasted with something like this, which is seen correctly as a variable assignment.

private _sectors = _opforSectors select {
  (markerPos _x distance _estimatedPos) < KPLIB_logistics_incidentWindow_distance
};

VsCode extension name

Hello,

I'm Florian, from the Odoo company. We are actually working on an extension for VsCode that we would like to publish on the Microsoft MarketPlace.
Unfortunately, according to Microsoft support, it seems that you already deployed an extension (but not publicly) that has the name Odoo. this extension lead us to your github https://github.com/Armitxes/VSCode_SQF
As you can imagine, we, as the official publisher, would like to be able to use our name to publish our extension. Would you agree to change your extension name and displayname in another name or unpublish it?
We would really appreciate it.

Thank you very much for your understanding

Auto-completion

Is there any plans to implement auto-completion with Intellisense?

Adding closing brackets

Why does enabling this extension make it so that when I type a ( it adds a closing ) immediately afterwards?

Highly annoying and disruptive.

New commands and functions

While loop snippet brackets issue

Hi, great job with your extension

Just noted that the while loop snippet has the wrong brackets

while (condition) do {
	
};

shoudl become this:

while {condition} do {
	
};

Multi-line string literals

Multi-line string literals lose their syntax highlighting. When breaking a string literal into multiple lines for readability the 'literal' highlighting goes away.

Example:
hint "hello this
is two lines";

The "is two lines" starts to get regular code highlighting.

Add ability to train the extension with commands

For things like HASHMAP, get, getOrDefault, etc. Also possibly for things like syntax colors. That way, between official releases ostensibly including the same definitions, we can at least keep our LINTs up to date in ways that matter to us.

Error "Request textDocument/hover failed." spam when hovering over anything

Hover over literally anything, even whitespace, and this error pops up in the console.

[Error - 10:32:15 am] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot set property '34' of undefined
  Code: -32603 

This log is shown on VSCode start

TypeError: Cannot set property '34' of undefined
    at SqfFile.parseFile (c:\Users\Connor\.vscode\extensions\armitxes.sqf-2.0.2\env\server\provider\SqfFile.js:69:79)
    at SqfFile.update (c:\Users\Connor\.vscode\extensions\armitxes.sqf-2.0.2\env\server\provider\SqfFile.js:30:22)
    at new SqfFile (c:\Users\Connor\.vscode\extensions\armitxes.sqf-2.0.2\env\server\provider\SqfFile.js:22:14)
    at SqfProject.getSqfFile (c:\Users\Connor\.vscode\extensions\armitxes.sqf-2.0.2\env\server\provider\SqfProject.js:37:33)
    at exports.documents.onDidChangeContent (c:\Users\Connor\.vscode\extensions\armitxes.sqf-2.0.2\env\server\init\variables.js:24:69)
    at CallbackList.invoke (c:\Users\Connor\.vscode\extensions\armitxes.sqf-2.0.2\node_modules\vscode-jsonrpc\lib\events.js:62:39)
    at Emitter.fire (c:\Users\Connor\.vscode\extensions\armitxes.sqf-2.0.2\node_modules\vscode-jsonrpc\lib\events.js:120:36)
    at connection.onDidOpenTextDocument (c:\Users\Connor\.vscode\extensions\armitxes.sqf-2.0.2\node_modules\vscode-languageserver\lib\main.js:181:38)
    at handleNotification (c:\Users\Connor\.vscode\extensions\armitxes.sqf-2.0.2\node_modules\vscode-jsonrpc\lib\main.js:489:43)
    at processMessageQueue (c:\Users\Connor\.vscode\extensions\armitxes.sqf-2.0.2\node_modules\vscode-jsonrpc\lib\main.js:260:17)

Inconsistent highlighting of keywords such a objNull

Will illustrate, this is fine:

params [
    ["_test", objNull]
];

This is fine:

private _y = objNull;

However, this does not highlight correctly.

private _y = ... ;
// ...
_y = objNull;

Or:

private ["_y"];
// ...
_y = objNull;

The use case is, when the variable is defined through private in some other place, assignment later on is a legitimate thing to be able to do. But it is not highlighting correctly.

There are probably related cases to this one, I don't know.

Thank you!

IntelliSense variable issue.

Not sure if its just me but I've been having problems with the IntelliSense and variables. With the latest update it will not autocomplete variables.
Capture2

private <array> marked as deprecated

private <array> shouldn't be marked as deprecated in arma 3.
A case, where it is usefull (defining variables on another scope):

private ["_myVar1", "_myVar2"];
switch (_switchvar) do {
    case 1: {_myVar1 = 1; _myVar2 = 1;};
    case 2: {_myVar1 = 2; _myVar2 = 2;};
    case 3: {_myVar1 = 3; _myVar2 = 3;};
    default {_myVar1 = 0; _myVar2 = 0;};
};

Or like in CBA, where you prevent variables from beeing overwritten:
https://github.com/CBATeam/CBA_A3/blob/7a1add1fc3f6227e5a10e329403d31138d5314cf/addons/settings/XEH_preInit.sqf#L45

VS Code plugin system disabled

This is not your fault, of course, but the team at microsoft have apparently disabled the plugin system entirely because they "weren't happy with it."

One wonders when they'll decide to re-add that particular feature. :/

Boolean values being highlighted as commands

Sometimes a boolean value is highlighted yellow as appose to blue. I believe this is due to true and false being listed in defg-key-statements and tuvw-key-statements. After removing them, the issue was fixed.

Wiki Crawler has wrong file open tag

This file isn't created by default, it needs to be in order to avoid this error

Traceback (most recent call last):
  File "/Users/morgan/Documents/Repos/VSCode_SQF/devHelper/wikiCrawler.py", line 80, in <module>
    with open(path, 'w') as jsonFile:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/morgan/Documents/Repos/VSCode_SQF/devHelper/output/sqfCmd.j /17m-21.4s

'"BIS_" function should not be overwritten' warning

" The "BIS_" function should not be overwritten. "BIS_" is an reserved namespace for functions by Bohemia Interactive "
It's very annoying warning showing up every time I use BIS_ function. I don't want to overwrite it. How can I disable it?

Corresponding opening/closing brackets not marked

On selecting an opening bracket with the cursor, the corresponding closing bracket should be marked. Same behaviour should of course occour with the opening bracket when the closing bracket is selected.

SQF Language Server Error

VS Code about output

Version: 1.31.0 (system setup)
Commit: 7c66f58312b48ed8ca4e387ebd9ffe9605332caa
Date: 2019-02-05T22:35:56.624Z
Electron: 3.1.2
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17134

An error shows up in the output windows after opening an sqf file.

  throw new ERR_INVALID_CALLBACK();
  ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at maybeCallback (fs.js:157:9)
    at Object.fs.writeFile (fs.js:1290:14)
    at c:\Users\bux\.vscode\extensions\armitxes.sqf-1.0.6\server\events.js:39:20
    at fs.js:753:9
    at FSReqWrap.oncomplete (fs.js:169:20)
[Info  - 10:30:21] Connection to server got closed. Server will restart.
[Error - 10:30:22] Notification handler 'workspace/didChangeConfiguration' failed with message: c:\Users\bux\.vscode\extensions\armitxes.sqf-1.0.6\syntaxes\sqf.min.json: Unexpected end of JSON input

image

After reloading the highlighting doesn't work anymore and I get the following new error message in the output window.

[Error - 10:33:51] Notification handler 'workspace/didChangeConfiguration' failed with message: c:\Users\bux\.vscode\extensions\armitxes.sqf-1.0.6\syntaxes\sqf.min.json: Unexpected end of JSON input

When inspecting the sqf.min.json it's just an empty 0kb file.

image

Add missing commands for Arma 3

Some older commands are missing and do not support syntax highlighting, for example

lbSetColorRight.

Any chance this could get updated?

Regards
R3vo

Extension doesn't respect editorconfig settings

VSCode 1.36.1
SQF Language v2.0.3
EditorConfig 0.13.0

When creating a new file it happens that editorconfig settings (especially spaces instead tabs) are ignored or rather change to back from spaces to tabs.

  1. Create a new file by using CTRL+N
  2. Hit CTRL+P and execute the command "Change language mode"
  3. Select "SQF" and press enter
  4. Observe in the lower right corner how the Indentation setting changes from Spaces to Tabs

editorconfig file used: https://github.com/acemod/ACE3/blob/master/.editorconfig

Support EXT

Currently the description.ext has no syntax highlighting. It should just be a simple config type of file which highlights the keys, values and classes. But it would be nice to see this added to this extension since it's related to Arma.

Missing curly brace definition

Hello!
If a comparison is present in the condition, then the closing curly brace is tagged "meta.brace.curly.sqf":
Desktop 2021-03-17 15-25-31_cr
But, if the condition has a short form, then the tag is absent:
Desktop 2021-03-17 15-25-42_cr
So when I try to colorize the curly braces,

"textMateRules": [
    {
        "scope": "meta.brace.curly.sqf",
        "settings": { "foreground": "#33ff00" }
    }
]

the closing parenthesis of the condition is not colored:
Desktop 2021-03-17 15-27-52_cr

Pattern

[-d] [-f] [-i] [-n] [-q] [-e ] [-x | -X] [--] [โ€ฆโ€‹]

IsEqualTo

IsEqualTo does not come up in the autocompletion

[SQF] Dark Theme and the .hpp files

It's really a minor thing but in the .hpp files, the words doesn't highlight properly. Also in some Wiki entries it seems there are missing lines like in "addPublicVariableEventHandler".

Add autocomplete for Format and params commands

Format could be auto-completed to:
format ["%1", /* Variables */]

Params could autocomplete to:
Params ["_var1"]
or some general form of:
params [["_logic",objNull,[objNull]]];

These two commands I have to consistently check the formatting of from the wiki.

Syntax highlighting broken at some point

If i look at the attatched File the highlighting works fine at the begining.
But from line 129 everything is just white. If i comment out line 123 it works up to line 144.

I cant figuere out why it does that.

1276095244

Add some easy way of declaring preproccesor defines

I use quite a bit of custom defines, and it would be nice if you could easily add some detection for this.
Think along the lines of GVAR, EGVAR like CBA and ACE use, but then also custom ones like CVAR, MVAR (All my mods have a 'core' and 'main' module) that I'd like to highlight like that.

Highlight (alternative color) for _local, public variables

Right now the pluging dont highlight the public, _local variables inside the code and uses the same code color.

Using a other sqf plugins like notepad++ you have 2 alternative colors to see clearly when is created a _local variable and when is a public variable.

Case sensitive commands

For example foreach is highlighted as white whereas forEach is highlighted blue. Commands should not be case sensitive in SQF.

User-indentation settings not respected

I have the setting editor.insertSpaces set to true because I prefer indentation using spaces. In SQF or EXT files, however, the default setting always is to indent by tabs. It would be great if this could be addressed since I always have to alter the settings manually.

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.