Giter Site home page Giter Site logo

bgforgenet / vscode-bgforge-mls Goto Github PK

View Code? Open in Web Editor NEW
15.0 7.0 5.0 6.55 MB

BGforge MultiLanguage server

Home Page: https://forums.bgforge.net/viewforum.php?f=35

License: Other

TypeScript 70.78% Shell 2.82% Python 26.21% CSS 0.07% HTML 0.13%
fallout baldurs-gate star-trek-scripting-language weidu infinity-engine vscode language-server fallout2

vscode-bgforge-mls's Introduction

BGforge multi-language server

VScode marketplace Patreon Telegram Discord IRC

Features | Screenshots | Install | Forum

BGforge MLS is a VScode extension adding support for Star-Trek Scripting Language (ssl) used in Fallout 1 and 2 games, and several file formats (d, baf, tp2, tra, 2da) used by WeiDU and Infinity Engine, as well as Sword Coast Stratagems Scripting Language (ssl/slb).

Features

Installation

  1. Search for BGforge in VScode marketplace, like any other extension. (Alternatively, download the package from Github releases tab and install it manually.)
  2. Check general settings.
  3. Check file associations.
  4. Check hotkeys.
  5. Enable custom theme and icon theme.
  6. (Infinity Engine) Install IElib.

Hotkeys

  • CTRL+R: compile (Fallout ssl) or parse (WeiDU tp2) file, reporting errors if any.

Screenshots

Infinity Engine highlighting and completion

infinity highlighting and completion example

Fallout highlighting and hovers

fallout highlighting and hover example

Error reporting

error reporting example

vscode-bgforge-mls's People

Contributors

4luke4 avatar bubb13 avatar burner1024 avatar dependabot[bot] avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-bgforge-mls's Issues

Separate bgforge.weidu.path by OS and default values

Hi,

can you separate bgforge.weidu.path by OS? Like this:

bgforge.weidu.path.win
bgforge.weidu.path.mac
bgforge.weidu.path.lin

This would also allow for having weidu.exe as the default value for Windows OS, weidu for mac/lin. The additional improvement by implementing this is that extension would work out-of-the-box if the weidu.exe is added to system PATH.

[SSL] Problems are shown at the wrong file

Screenshot

image
image
image

What's wrong on screenshot

Based on compiler output, error is in the header, but plugin points to a random spot in ssl file instead.

Code

compilertest.ssl

#include "compilertest.h"

procedure start begin
    display_msg("Hello world!!!");
end

compilertest.h

procedure ceil(variable v) begin
    return v
end

.bgforge.yml is case sensitive for Fallout .msg vs .ssl files?

Screenshot

bgforge yml doesn't recognize different case

What's wrong on screenshot

It looks like the .msg file isn't recognized if its a different case, but for some reason changing the .ssl file to all lower case didn't fix the issue.
Where does bgforge look for the matching filename? and is it possible to configure it to be case insensitive?

Code


Add some Fallout-style defines for IE

I'm getting tired of having to comment magical constants manually all the time:

Captura de pantalla de 2020-01-26 12-22-29

Not to mention, this is prone to errors. We could instead define those constants and use them in code:

Captura de pantalla de 2020-01-26 12-23-53

The actual definition would be either in an external weidu lib - bunch of SET/SPRINT, or could be handled by a preprocessor.

Missing highlight for `WRITE_ASCIIL`

Screenshot

image

What's wrong on screenshot

Missing highlight for WRITE_ASCIIL

Code

  COPY ~%MOD_FOLDER%/cre/er_love1.cre~ ~override/er_love1.cre~
    SAY NAME1 @103
    SAY NAME2 @103
    WRITE_ASCII 0x2cc ~er_love1~ #8
    WRITE_ASCII 0x280 ~er_love1~ #32
    WRITE_ASCII 0x258 ~~ #8
    WRITE_ASCIIL 0x34 ~~ ~~

Indicate field size somehow

It would be great to have some visual indicator of the field size for IElib constants, to know when to use READ_BYTE vs READ_SHORT, etc. Maybe not for all types, but at least for the common ones.

Some options:

  1. Append a corresponding suffix (_b, _w, _dw, etc) in IElib itself. A bit clunky and the names are long already. But simple enough and works.
  2. Indicate in the tooltip. Not as visible, and will require much larger rewrite of how IElib works.
  3. Some scopes in Monokai are still unused. There's underlining, italic, etc. However, using those for constants would not be in line with other languages, and somewhat confusing because of that.
  4. Make a custom Monokai fork and ship it with the extension and let users know to enable it. Not user-friendly, and likely a large maintenance burden.
  5. Maybe Monokai supports some kind of customizaion/overrides? That way, it could be extended to support more scopes with different indicators.
  6. Check if there are any other themes, (preferably Monokai-based), that allow distinguishing between different constant types.
  7. Anything else?

Any option would require changes to IElib, though, because the information about type has to come from somewhere.

Error: ENOENT: no such file or directory, lstat 'C:\Users\ALIEN\AppData\Local\Programs\Microsoft VS Code Insiders\undefined'

Screenshot

What's wrong on screenshot

Code

onInitialize started
onInitialize completed
onInitialized started
{"code":"ERR_INVALID_ARG_TYPE"}
initializing translation
tra is not a directory, aborting tra load
initialized
reload filedata file:///e%3A/Gry-IE/BG2EE-SoS/SoSCre/lib/install-cre.tpa
node:fs:2538
      handleErrorFromBinding(ctx);
      ^

Error: ENOENT: no such file or directory, lstat 'C:\Users\ALIEN\AppData\Local\Programs\Microsoft VS Code Insiders\undefined'
    at Object.realpathSync (node:fs:2538:7)
    at Object.<anonymous> (node:electron/js2c/asar_bundle:2:4804)
    at ui (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:167:5422)
    at Ss.inWorkspace (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:220:3646)
    at Ss.displayPath (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:220:3710)
    at Ss.reloadFileData (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:220:4672)
    at nc.reloadFileData (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:223:3319)
    at c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:228:4638 {
  errno: -4058,
  syscall: 'lstat',
  code: 'ENOENT',
  path: 'C:\\Users\\ALIEN\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\undefined'
}
[Info  - 8:29:28 PM] Connection to server got closed. Server will restart.
true
onInitialize started
onInitialize completed
onInitialized started
{"code":"ERR_INVALID_ARG_TYPE"}
initializing translation
tra is not a directory, aborting tra load
initialized
reload filedata file:///e%3A/Gry-IE/BG2EE-SoS/SoSCre/lib/install-cre.tpa
node:fs:2538
      handleErrorFromBinding(ctx);
      ^

Error: ENOENT: no such file or directory, lstat 'C:\Users\ALIEN\AppData\Local\Programs\Microsoft VS Code Insiders\undefined'
    at Object.realpathSync (node:fs:2538:7)
    at Object.<anonymous> (node:electron/js2c/asar_bundle:2:4804)
    at ui (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:167:5422)
    at Ss.inWorkspace (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:220:3646)
    at Ss.displayPath (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:220:3710)
    at Ss.reloadFileData (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:220:4672)
    at nc.reloadFileData (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:223:3319)
    at c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:228:4638 {
  errno: -4058,
  syscall: 'lstat',
  code: 'ENOENT',
  path: 'C:\\Users\\ALIEN\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\undefined'
}
[Info  - 8:29:28 PM] Connection to server got closed. Server will restart.
true
onInitialize started
onInitialize completed
onInitialized started
{"code":"ERR_INVALID_ARG_TYPE"}
node:fs:2538
      handleErrorFromBinding(ctx);
      ^

Error: ENOENT: no such file or directory, lstat 'C:\Users\ALIEN\AppData\Local\Programs\Microsoft VS Code Insiders\undefined'
    at Object.realpathSync (node:fs:2538:7)
    at Object.<anonymous> (node:electron/js2c/asar_bundle:2:4804)
    at ui (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:167:5422)
    at Ss.inWorkspace (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:220:3646)
    at Ss.displayPath (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:220:3710)
    at Ss.reloadFileData (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:220:4672)
    at nc.reloadFileData (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:223:3319)
    at c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:228:4638 {
  errno: -4058,
  syscall: 'lstat',
  code: 'ENOENT',
  path: 'C:\\Users\\ALIEN\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\undefined'
}
initializing translation
tra is not a directory, aborting tra load
[Info  - 8:29:28 PM] Connection to server got closed. Server will restart.
true
onInitialize started
onInitialize completed
onInitialized started
{"code":"ERR_INVALID_ARG_TYPE"}
node:fs:2538
      handleErrorFromBinding(ctx);
      ^

Error: ENOENT: no such file or directory, lstat 'C:\Users\ALIEN\AppData\Local\Programs\Microsoft VS Code Insiders\undefined'
    at Object.realpathSync (node:fs:2538:7)
    at Object.<anonymous> (node:electron/js2c/asar_bundle:2:4804)
    at ui (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:167:5422)
    at Ss.inWorkspace (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:220:3646)
    at Ss.displayPath (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:220:3710)
    at Ss.reloadFileData (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:220:4672)
    at nc.reloadFileData (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:223:3319)
    at c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:228:4638 {
  errno: -4058,
  syscall: 'lstat',
  code: 'ENOENT',
  path: 'C:\\Users\\ALIEN\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\undefined'
}
initializing translation
tra is not a directory, aborting tra load
[Info  - 8:29:31 PM] Connection to server got closed. Server will restart.
true
onInitialize started
onInitialize completed
onInitialized started
{"code":"ERR_INVALID_ARG_TYPE"}
initializing translation
tra is not a directory, aborting tra load
initialized
reload filedata file:///e%3A/Gry-IE/BG2EE-SoS/SoSCre/lib/install-cre.tpa
node:fs:2538
      handleErrorFromBinding(ctx);
      ^

Error: ENOENT: no such file or directory, lstat 'C:\Users\ALIEN\AppData\Local\Programs\Microsoft VS Code Insiders\undefined'
    at Object.realpathSync (node:fs:2538:7)
    at Object.<anonymous> (node:electron/js2c/asar_bundle:2:4804)
    at ui (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:167:5422)
    at Ss.inWorkspace (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:220:3646)
    at Ss.displayPath (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:220:3710)
    at Ss.reloadFileData (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:220:4672)
    at nc.reloadFileData (c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:223:3319)
    at c:\Users\ALIEN\.vscode-insiders\extensions\bgforge.bgforge-mls-2.1.2\server\out\server.js:228:4638 {
  errno: -4058,
  syscall: 'lstat',
  code: 'ENOENT',
  path: 'C:\\Users\\ALIEN\\AppData\\Local\\Programs\\Microsoft VS Code Insiders\\undefined'
}
[Error - 8:29:32 PM] The BGforge MLS server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

"Detail" should not be missing

OK, latest version (v1.0.5) - I noticed that "detail" (from weidu.completion.yml) no longer shows up upon hovering over a specific tp2-action/flag/whatever.

For instance, if you hover over ACTION_IF, then you'll only see its documentation but not the following => ACTION_IF value THEN BEGIN TP2 Action list END [ ELSE BEGIN TP2 Action list END ]

[highlighting] SSL 'call' colorizing incosistency

  • procedure name is not colorized when using call proc(); syntax
    skipping () and using call proc; syntax works correctly
  • procedure name is not colorized if there's at least 1 whitespace between name and (
    engine/sfall functions does not have that problem, and are colorized correctly

Both are edge cases; first probably overlooked as scripts i checked simply skip () - for me it's a muscle memory due to messing with C-like langs :} Second can be spotted only if someone wants to write pretty code and align arguments at same position when using block of procs with different names length; haven't seen anything like that in regular mods either.

image

BGforge MLS v2.0.0 Server crashes when opening mod folder

Description

When opening a folder with a modification (in my case it is NTotSC), there is a VS Code notification about plugin's server crash.
Visual Studio Code version: 1.74.3

Console output

onInitialize started
workspace_root = c:\<path to mod>\NTotSC
onInitialize completed
onInitialized started
{"errno":-4058,"syscall":"open","code":"ENOENT","path":"c:\\<path to mod>\\NTotSC\\.bgforge.yml"}
initializing translation
tra is not a directory, aborting tra load
initialized
reload filedata file:///c%3A/<path to mod>/NTotSC/ntotsc/ntotsc.tp2
node:fs:2490
      handleErrorFromBinding(ctx);
      ^

Error: ENOENT: no such file or directory, lstat 'c:\c:'
    at Object.realpathSync (node:fs:2490:7)
    at Object.<anonymous> (node:electron/js2c/asar_bundle:5:4831)
    at li (c:\Users\<user>\.vscode\extensions\bgforge.bgforge-mls-2.0.0\server\out\server.js:167:5395)
    at ws.inWorkspace (c:\Users\<user>\.vscode\extensions\bgforge.bgforge-mls-2.0.0\server\out\server.js:220:3646)
    at ws.displayPath (c:\Users\<user>\.vscode\extensions\bgforge.bgforge-mls-2.0.0\server\out\server.js:220:3710)
    at ws.reloadFileData (c:\Users\<user>\.vscode\extensions\bgforge.bgforge-mls-2.0.0\server\out\server.js:220:4472)
    at Zo.reloadFileData (c:\Users\<user>\.vscode\extensions\bgforge.bgforge-mls-2.0.0\server\out\server.js:223:3109)
    at c:\Users\<user>\.vscode\extensions\bgforge.bgforge-mls-2.0.0\server\out\server.js:228:4643 {
  errno: -4058,
  syscall: 'lstat',
  code: 'ENOENT',
  path: 'c:\\c:'
}
[Error - 20:45:27] The BGforge MLS server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

Weird behavior when using "" or ~~

Let's consider the following example:

LAF DELETE_SCRIPT_BLOCK
STR_VAR
	script = ~GTSUM00~
	match = EVAL "RESPONSE #100[%WNL%%LNL%%MNL%]*END"
END

All the code that follows this line match = EVAL "RESPONSE #100[%WNL%%LNL%%MNL%]*END" is highlighted in yellow (as if a string delimiter is missing).

Why!?
Missing string delimiter ?

Add support for 2DA files

Pretty much what the title says.

I'd like to have .2da syntax highlighting (so that they don't look like plain text files). Something similar to what you've recently done with .tra files.

[Fallout] Errors in header files never go away from "Problems"

Screenshot

изображение

What's wrong on screenshot

Errors in header files never go away from "Problems"

Code

_mls_test.h:

#define cantdoit(1)

_mls_test.ssl:

#include "_mls_test.h"

procedure start begin
   display_msg("Hello");
end

Try compiling above SSL, you'll get error like on screenshot. Add space before (1) to fix the error, then recompile. Error stays.

Use parameters data from actual code when jsdoc is used

Screenshot

изображение

What's wrong on screenshot

  • If you add jsdoc comment but omit some arguments, they disappear from the argument list in the hint.
  • If you have default value in code itself, it is not reflected in the hint, you have to duplicate this information in the jsdoc

Code

/**
 * Adds one recipe item for a given crafted item, if it doesn't exist. If recipe is known, deletes the item.
 * 
 * @arg {int} schematicPid - PID of schematic item to create
 * @arg {int} probability - % probability of spawn, if conditions are met.
 */
procedure check_restock_craft_schematic(variable schematicPid, variable craftedItemPid, variable probability := 100) begin
end

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.