bash-lsp / bash-language-server Goto Github PK
View Code? Open in Web Editor NEWA language server for Bash
License: MIT License
A language server for Bash
License: MIT License
ALE Now supports bash-language-sever
out of the box, if installed, and requires no configuration for it to start running.
There is a fully valid Bash script https://github.com/docksal/docksal/blob/develop/bin/fin
When I load it in VSCode that uses bash language server it reports 111 issues.
We can treesitter to improve the parsing error messages:
SyntaxNode.hasError()
API to show if parts of a script fail to parse (see tree-sitter/tree-sitter-bash#27 (comment))Currently the outline view simply shows a flat list of all symbols in the file. I believe that you can get a hierarchical view if you return a bit more information (I think it's the name of the parent)
I'm getting an error when i have statements like this one:
echo "$((1 << 5))"
Version: 1.5.4
Here document explanation: https://en.wikipedia.org/wiki/Here_document#Unix_shells
Simplified version of source that shows the problem:
methodname() {
cat > file.txt << EOF
File contents
EOF
echo "I'm still here"
}
When you minimize the method, it only minimizes until it hits the second EOF. Expected behavior is to minimize to the ending curly brace. I'm using vscode.
Go to declaration at references to project
doesn't work.
for project in $(ls ~/dev/${kind}); do
path="${HOME}/dev/${kind}/${project}"
echo "Checking project ${path}"
# Check if there are any unpushed branches
if is-git-repository; then
cd "${path}" && git log --branches --not --remotes --no-walk --decorate --oneline
fi
done
This will make it easier for users to see what's new and fixed in a given release.
I am using Bash IDE in VSCode and below code shows as invalid code while it is valid code
TEST_VAR=1
TEST_VAR1=1
declare -a list_of_variables=("TEST_VAR" "TEST_VAR1")
for var in ${list_of_variables[@]}
do
echo "${var}=${!var}"
done
When I hover over !
char then it show 'Failed to parse expression' in tooltip
Seeing this when I switch to a bash file, in Visual Studio Code 1.20.1, Windows 10, extension v. 1.1.4:
module.js:672
return process.dlopen(module, path._makeLong(filename));
^
Error: \\?\C:\Users\asampaleanu\.vscode\extensions\mads-hartmann.bash-ide-vscode-1.1.4\server\node_modules\tree-sitter\build\Release\tree_sitter_runtime_binding.node is not a valid Win32 application\\?\C:\Users\asampaleanu\.vscode\extensions\mads-hartmann.bash-ide-vscode-1.1.4\server\node_modules\tree-sitter\build\Release\tree_sitter_runtime_binding.node
at Object.Module._extensions..node (module.js:672:18)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\asampaleanu\.vscode\extensions\mads-hartmann.bash-ide-vscode-1.1.4\server\node_modules\tree-sitter\index.js:1:125)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
[Info - 9:28:54 AM] Connection to server got closed. Server will restart.
module.js:672
return process.dlopen(module, path._makeLong(filename));
Function names such as test:1
and test-1-1
shows up as test
on code hinting.
test_1
shows up properly.
Until we've perfected the Bash tree-sitter grammar it would be nice to be able to disable showing the parse errors.
EXPLAINSHELL_ENDPOINT
is there to configure the source of the explainshell service, whether it would point to explainshell.com or a local Docker container. I would envision people to configure this environment variable somewhere globally, do it once and forget.
However, there could be times when the explainshell service is not running: Docker container image is stopped, or you have no internet access at the moment.
Currently, when EXPLAINSHELL_ENDPOINT
is set, but the endpoint is not available, the editor is being spammed with an error:
I would like to propose to silently ignore this specific case, when the endpoint is not available, and just continue to try the other existing methods of getting the hover information.
What do you think?
It would be great if the user could provide more file extensions to parse. At the moment, only *.sh
files are found and parsed:
When working with Bash scripts that use a different extension, e.g. .bash
, the bash language server currently does not work.
It would be great if there was a configuration option that would allow to list the extensions that should be scanned...
This is vscode specific, but should be very easy to add as we have the tree-sitter AST. https://code.visualstudio.com/updates/v1_22#_folding-provider-api
I am using Bash IDE extension in VSCode. And installed bash-language-server as descripted in its details.
Now I have two problems. One is apparently something is wrong. The other is "I am not sure".
Code prompt are all non-sense. For example, I typed "then", I got "thinkjettopbm". I typed "case", I got "catchsegv".
Code completion does not work. In my idea, this is something like, when I typed "case", it would insert the "esac". But in my IDE, it does not. Just marks a bunch of lines "syntax error" red underlines.
What should I do?
For the life of me, I can't get this package to install in NPM. Maybe I'm just doing this really incredibly wrong, or my system needs to be configured differently.
Install command: sudo npm i -g bash-language-server
While the project is installing, I see TONS of these error messages:
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/lib/node_modules/bash-language-server/node_modules/tree-sitter/.node-gyp/10.4.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/bash-language-server/node_modules/tree-sitter/.node-gyp"
After the installer finishes, I get a fatal error:
npm-error.txt
Here's the debug.log:
2018-06-11T18_11_37_553Z-debug.log
Hello,
while using Bash IDE 1.3.2 I keep getting these kind of errors from the bash-language-server component (v1.5.2):
[...]
Analyzing file:///home/user/myproject/target/coverage/bash-helper.sh
fs.js:646
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open '/home/user/myproject/target/coverage/run_tests.sh'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at paths.forEach.p (/usr/lib/node_modules/bash-language-server/out/analyser.js:64:91)
at Array.forEach (<anonymous>)
at glob (/usr/lib/node_modules/bash-language-server/out/analyser.js:60:27)
at f (/usr/lib/node_modules/bash-language-server/node_modules/once/once.js:25:25)
at Glob.<anonymous> (/usr/lib/node_modules/bash-language-server/node_modules/glob/glob.js:151:7)
at emitOne (events.js:116:13)
at Glob.emit (events.js:211:7)
at Glob._finish (/usr/lib/node_modules/bash-language-server/node_modules/glob/glob.js:197:8)
Analyzing file:///home/user/myproject/target/coverage/run_tests.sh
[Error - 11:29:29] Connection to server got closed. Server will not be restarted.
This is due to the fact that the /home/user/myproject/target/coverage/run_tests.sh
is a symlink to a directory, that kcov automatically created to mimic the name of the file that originated the report. This causes the language server to crash continuously, reaching the retry attempts limit, as noted in the last line of output.
As suggested also in #47, I think that using the mime type information or, in any case, performing some kind of check on the file prior to opening it for analysis would solve this issue too.
I'm running on a Slackware64 Linux 14.2 box, using VS Code 1.25.0.
Hi there,
Started looking at building this myself on WSL after attempting to install with npm i -g bash-language-server
failed.
It may be academic, but in the build process I had to work out for myself that I would need node
(v6 or greater), make
and g++
installed. Probably not unique to WSL, but I'm a bit of a novice when it comes to building things that aren't .NET
π
Hello Everyone,
So I'm having some fun trying to get the bash language server with the explainshell integration working.
I have the explainshell container running and my settings look like:
{
"files.autoSave": "afterDelay",
"editor.tabSize": 2,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/secrets": true
},
"ruby.lint": {
"rubocop": true,
"ruby": true, //Runs ruby -wc
},
"python.pythonPath": "/usr/local/opt/python@2/bin/python2.7",
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.enabled": true,
"python.linting.pylintPath": "/usr/local/bin/pylint",
"bashIde.explainshellEndpoint": "http://localhost:5000"
}
If I browse to localhost:5000 in my browser everything works 100%. The container access logs only show the browser requests and I do not see bash-language-server trying to communicate at all.
Thoughts?
How can I use it in vim?
If not, is there plan to support vim?
local key
local -A assArray=(['a']=0 ['b']=1)
for key in "${!assArray[@]}"; do
printf 'Key: %s, Value: %s\n' "${key}" "${assArray[${key}]}"
done
"${!assArray[@]}"
Fails to parse due to the index expansion operator, !
.
This feature was added to bash in version 3.0.
See atom/atom-languageclient for details on how to implement the client in Atom
If yarn is used for development (see #21 ), maybe it will be also good to make the project itself use yarn by default?
Currently (especially in vscode-client) npm is used by default, and the underlying bash-language-server is located using npm bin -g
.
Is it possible to replace (or extend) this by yarn global bin
etc.?
I plugged in the docker "explain shell" container today and almost every time I move the cursor or type something the terminal window re-opens and prints out loads of text I don't need to see.
Or better yet, I "could see it if I choose" and otherwise I expect that kind of noise to sit in the background. It almost makes the Bash-IDE unsuable.
It would be helpful if hovering over keywords (local
, for
, while
, etc.) showed some documentation.
Hi, I use LanguageClient-neovim + deoplete for completions in neovim. I get the following error when I try to access documentation:
Request textDocument/hover failed with message: undefined is not a valid argument for URI
also, I do not get any completion for flags, i.e. grep -|
(cursor at |
) does not trigger anything.
textDocument/DocumentSymbols also gives missing field `kind`
. Other features seem to work well.
File mode specification error: (lsp-timed-out-error)
When using a version manager like nvm
VS Code will not have the npm I am using in the PATH, only the shell. Since I have many versions of node/npm installed, I would like to tell the VS Code extension to use a specific one. This could also be useful for debugging.
Hovering over 21:22
[Error - 10:43:37 PM] Request textDocument/hover failed.
Message: Request textDocument/hover failed with message: Error: connect ECONNREFUSED 127.0.0.1:5000
Code: -32603
What should I do?
A client can send a MarkupKind[]
capability for completion
, signatureHelp
and hover
(search for MarkupKind[]
string here), but as far as I can tell the current code ignores this and always responds with a "markdown".
Looks like the build failed.
$ npm run check:bail
> @ check:bail /home/travis/build/mads-hartmann/bash-language-server
> npm run lint:bail && npm run test
> @ lint:bail /home/travis/build/mads-hartmann/bash-language-server
> tslint --project vscode-client && tslint --project server
> @ test /home/travis/build/mads-hartmann/bash-language-server
> jest --runInBand --forceExit
FAIL server/src/__tests__/analyzer.test.ts
β Test suite failed to run
Cannot find module 'source-map-support' from 'install.js'
at Resolver.resolveModule (node_modules/jest/node_modules/jest-cli/node_modules/jest-runtime/node_modules/jest-resolve/build/index.js:169:17)
at Object.<anonymous> (node_modules/ts-jest/dist/install.js:3:24)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 2.156s
Ran all test suites.
See the 1.26 VSCode update: https://code.visualstudio.com/updates/v1_26#_definitionlink
I've installed the package as advised but the extension fails with this error:
PS C:\Users\fakui> npm i -g bash-language-server
C:\Users\fakui\AppData\Roaming\npm\bash-language-server -> C:\Users\fakui\AppData\Roaming\npm\node_modules\bash-language-server\bin\main.js
+ [email protected]
updated 1 package in 1.253s
PS C:\Users\fakui> node -v
v10.0.0
PS C:\Users\fakui> (Get-ChildItem Env:Path).Value
C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Python36\Scripts\;C:\Program Files\Python36\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Common Files\Autodesk Shared\;D:\Program_Files\Strawberry\c\bin;D:\Program_Files\Strawberry\perl\site\bin;D:\Program_Files\Strawberry\perl\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Program Files\nodejs\;C:\Users\fakui\AppData\Local\Microsoft\WindowsApps;;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\fakui\AppData\Roaming\npm
Are developers expected to have Python installed? If yes, could this be mentioned in the README.md somewhere?
> git clone https://github.com/mads-hartmann/bash-language-server.git
Cloning into 'bash-language-server'...
remote: Counting objects: 125, done.
remote: Compressing objects: 100% (82/82), done.
remote: Total 125 (delta 64), reused 94 (delta 39), pack-reused 0
Receiving objects: 100% (125/125), 62.22 KiB | 0 bytes/s, done.
Resolving deltas: 100% (64/64), done.
> cd bash-language-server
> npm install
(node:8060) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
(node:8060) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
(node:8060) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
(node:8060) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
(node:8060) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
(node:8060) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
(node:8060) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
(node:8060) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
(node:8060) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
npm WARN prefer global [email protected] should be installed with -g
> [email protected] postinstall bash-language-server
> cd server && npm install && cd ../vscode-client && npm install && cd ..
> [email protected] install bash-language-server\server\node_modules\tree-sitter
> node-gyp rebuild
bash-language-server\server\node_modules\tree-sitter>if not defined npm_config_node_gyp (node "npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:449:14)
gyp ERR! stack at npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:404:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd bash-language-server\server\node_modules\tree-sitter
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
[email protected] bash-language-server\server
+-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| `-- [email protected]
+-- [email protected]
| `-- [email protected]
`-- [email protected]
+-- [email protected]
| +-- [email protected]
| `-- [email protected]
`-- [email protected]
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v8.9.4
npm ERR! npm v3.10.7
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the tree-sitter package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs tree-sitter
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls tree-sitter
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! bash-language-server\server\npm-debug.log
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v8.9.4
npm ERR! npm v3.10.7
npm ERR! code ELIFECYCLE
npm ERR! [email protected] postinstall: `cd server && npm install && cd ../vscode-client && npm install && cd ..`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'cd server && npm install && cd ../vscode-client && npm install && cd ..'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bash-language-server package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cd server && npm install && cd ../vscode-client && npm install && cd ..
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bash-language-server
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bash-language-server
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! bash-language-server\npm-debug.log
Add an example of how to use the bash language server with Emacs.
I'm not familiar with npm but your installation instructions looked easy. However I am getting errors when trying to install the bash language server on ubuntu 18.04. (my eventual goal is to try using this via the emacs lsp-sh mode)
Running the stated installation command gives:
[tree of packages to install]
npm ERR! Linux 4.4.0-134-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "i" "-g" "bash-language-server"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! path /usr/local/lib
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /home/len/npm-debug.log
Running as administrator doesn't help:
$ sudo npm i -g bash-language-server
loadDep:lodash | |##################################################---------------------------------------------------------------------------------------------------------------------------------------------------|
loadDep:tr46 -> request \ |##############################################################---------------------------------------------------------------------------------------------------------------------------------------|
loadDep:vscode-languagese \ |######################################################################-------------------------------------------------------------------------------------------------------------------------------|
/usr/local/bin/bash-language-server -> /usr/local/lib/node_modules/bash-language-server/bin/main.js
> [email protected] install /usr/local/lib/node_modules/bash-language-server/node_modules/tree-sitter-bash
> prebuild-install || node-gyp rebuild
/usr/bin/env: βnodeβ: No such file or directory
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:354:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-134-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/bash-language-server/node_modules/tree-sitter-bash
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
/usr/local/lib
`-- (empty)
npm ERR! Linux 4.4.0-134-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "i" "-g" "bash-language-server"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'prebuild-install || node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the tree-sitter-bash package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! prebuild-install || node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs tree-sitter-bash
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls tree-sitter-bash
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/len/npm-debug.log
npm ERR! code 1
Looks like 18.04 node may be too old. After updating nodejs to the latest it still doesn't work:
$ sudo npm i -g bash-language-server
/usr/bin/bash-language-server -> /usr/lib/node_modules/bash-language-server/bin/main.js
> [email protected] install /usr/lib/node_modules/bash-language-server/node_modules/tree-sitter
> prebuild-install || node-gyp rebuild
prebuild-install WARN install EACCES: permission denied, mkdir '/usr/lib/node_modules/bash-language-server/node_modules/tree-sitter/build'
gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/len/.node-gyp/10.11.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/bash-language-server/node_modules/tree-sitter/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/bash-language-server/node_modules/tree-sitter/.node-gyp'
gyp ERR! System Linux 4.4.0-134-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/bash-language-server/node_modules/tree-sitter
gyp ERR! node -v v10.11.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/len/.npm/_logs/2018-10-02T20_51_16_481Z-debug.log
Please help?
It would be nice to add configuration instructions for Vim (as it's currently done for Neovim), since setting up the plug-in is slightly more involved than with other IDE's/editors.
Investigate if we can use prebuild and prebuild-install and then have the bash-language-server as a direct dependency on the vscode extension. The goal is to avoid having to install the server separately for vscode.
Just installed this, and it works really nicely! Jump to definition and parsing errors are really nice.
Would be nice to improve the code completions. VS Code per default autocompletes on words, but this is disabled when using a language server I guess. : )
Ideas from the TODO file:
foo/b
should return bar
if you have a file named bar
inside of a folder named foo
Ideas from the source code :
The output is:
mymac:~ root# npm install -g bash-language-server
/opt/local/bin/bash-language-server -> /opt/local/lib/node_modules/bash-language-server/bin/main.js
[email protected] install /opt/local/lib/node_modules/bash-language-server/node_modules/tree-sitter
prebuild-install || node-gyp rebuild
prebuild-install || node-gyp rebuild
Thanks for the help!
This one seems to be related to this extension rather then tree-sitter, correct me if I am wrong.
Bash IDE highlights the whole function (or even the whole file!) as erroneous, despite parsing error actually happens only in a single line of the function. Example:
And even worse when it is the whole file
So the issue here is the line [[ "$x" == *"something something"* ]]
. If I remove it, the underline will be gone. It is a Tree-sitter issue and this is fine, I will report it and hope they will fix it.
What is puzzling here is why Bash IDE has highlighted the whole file in red, rendering it impossible to spot the problematic place. I would expect Bash IDE to only highlight the line, where the error has happened. Maybe also the function name.
But not all the lines in the function and definitely not all the lines in the file.
As bash developer I really want to see those highlights, because it helps to spot error early, but they need to be meaningful to be useful.
failed to parse expression for :
for (( i=2 ; i <= n ; i++ )) {
echo $i
}
When I install the tool via npm
, my editor doesn't display any information from bash-language-server, as if I don't have it installed. When I compile the latest master from source, everything works.
I also tried npm install bash-language-server
(so that it installs locally a fresh installation) and pointing my editor to the binary, still no luck.
I'm honestly puzzled, and the first thing I want to ask is this: is it possible that whatever got on npm.com doesn't match the current master?
For the file at https://sourcegraph.com/github.com/nodejs/node/-/blob/tools/update-babel-eslint.sh:
npm init
is properly documented but the install
in npm install
is interpreted as the global install
Unix command not the npm install
subcommandThis happens because explainshell is currently a fallback plan, but probably should be the first choice.
It would be cool if you coordinated your efforts with @rogalmic as soon as the extension already has such cool name
Check out Explainshell:
https://explainshell.com/explain?cmd=tar%20xzvf%20archive.tar.gz
Could Explainshell be integrated into bash-language-server?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.