Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update npm package dependencies, in order to support the latest version of the Language Server Protocol #134

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ node_modules
nimsuggest/nimcache
nimsuggest/nimsuggest.exe
nimsuggest/nimsuggest
*.vsix
*.vsix
nimble.develop
nimble.paths
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Nim Extension

Visual Studio:
[![Version](https://vsmarketplacebadge.apphb.com/version/nimsaem.nimvscode.svg)](https://marketplace.visualstudio.com/items?itemName=nimsaem.nimvscode)
[![Installs](https://vsmarketplacebadge.apphb.com/installs/nimsaem.nimvscode.svg)](https://marketplace.visualstudio.com/items?itemName=nimsaem.nimvscode)
[![Ratings](https://vsmarketplacebadge.apphb.com/rating/nimsaem.nimvscode.svg)](https://vsmarketplacebadge.apphb.com/rating/nimsaem.nimvscode.svg)
[![Version](https://vsmarketplacebadges.dev/version/nimsaem.nimvscode.svg)](https://marketplace.visualstudio.com/items?itemName=nimsaem.nimvscode)
[![Installs](https://vsmarketplacebadges.dev/installs/nimsaem.nimvscode.svg)](https://marketplace.visualstudio.com/items?itemName=nimsaem.nimvscode)
[![Ratings](https://vsmarketplacebadges.dev/rating/nimsaem.nimvscode.svg)](https://vsmarketplacebadge.apphb.com/rating/nimsaem.nimvscode.svg)

Open-VSX:
[![Version](https://img.shields.io/open-vsx/v/nimsaem/nimvscode)](https://open-vsx.org/extension/nimsaem/nimvscode)
Expand Down Expand Up @@ -218,6 +218,7 @@ This extension relies on nimsuggest for code completion. Nimsuggest is basically
## Developing the Extension

* If this is the first time you're building the extension on your machine, do an npm install to get the dependencies
* You should also copy (or create a symlink to) the `nimsuggest` directory from the Nim compiler sources into `src/nimsuggest`
* Press `F5` or whatever your `Run -> Start Debugging` command short cut is
* If prompted choose launch `Extension`
* This launches a new VS Code Window which is running your patched extension
Expand Down
2 changes: 1 addition & 1 deletion nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

define:nimsuggest
define:nodejs
define:js
#define:js
21 changes: 10 additions & 11 deletions nimvscode.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ bin = @["nimvscode"]

# Deps

requires "nim >= 1.3.7"
requires "compiler >= 1.3.7"
requires "nim == 1.6.16"

import std/os

Expand All @@ -22,18 +21,18 @@ proc initialNpmInstall =

# Tasks
task main, "This compiles the vscode Nim extension":
exec "nim js --outdir:out --checks:on --sourceMap src"/"nimvscode.nim"
exec "nim js --outdir:out --checks:on --sourceMap src/nimvscode.nim"

task release, "This compiles a release version":
exec "nim js -d:release -d:danger --outdir:out --checks:off --sourceMap src"/"nimvscode.nim"
exec "nim js -d:release -d:danger --outdir:out --checks:off --sourceMap src/nimvscode.nim"

task vsix, "Build VSIX package":
initialNpmInstall()
exec "npm exec -c 'vsce package --out out"/"nimvscode-" & version & ".vsix'"
exec "npm exec -c 'vsce package --out out/nimvscode-" & version & ".vsix'"

task install_vsix, "Install the VSIX package":
initialNpmInstall()
exec "code --install-extension out"/"nimvscode-" & version & ".vsix"
exec "code --install-extension out/nimvscode-" & version & ".vsix"

# Tasks for maintenance
task audit_node_deps, "Audit Node.js dependencies":
Expand All @@ -47,8 +46,8 @@ task upgrade_node_deps, "Upgrade Node.js dependencies":
exec "npm install"
echo "NOTE: 'engines' versions in 'package.json' need manually upgraded"

# Tasks for publishing the extension
task extReleasePatch, "Patch release on vscode marketplace and openvsx registry":
initialNpmInstall()
exec "npm exec -c 'vsce publish patch'" # this bumps the version number
exec "npm exec -c 'ovsx publish out"/"nimvscode-" & version & ".vsix'"
# # Tasks for publishing the extension
# task extReleasePatch, "Patch release on vscode marketplace and openvsx registry":
# initialNpmInstall()
# exec "npm exec -c 'vsce publish patch'" # this bumps the version number
# exec "npm exec -c 'ovsx publish " & out/nimvscode-" & version & ".vsix & "'"
Loading