Code Monkey home page Code Monkey logo

lsp-bash's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar jackenmen avatar jfcherng avatar predragnikolic avatar rchl avatar rwols 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

Watchers

 avatar  avatar  avatar  avatar

lsp-bash's Issues

LSP sub menu options are all grayed out (except for 'go to symbol ref' & ' find symbol def'

First of all - sorry if this is a configuration issue on my part and not an issue with the package itself - I am new to both Sublime and LSPs.

I installed the LSP following the doc's to the best of my advice - upon start the LSP is listed as up and running and Sublime's log says that there were no issues with the startup of the program or any of the packages.
Then when I right click on a variable inside a bash file to access the LSP sub menu all the options are grayed out except for:
'Go To Symbol Reference' & 'Find Symbol Definition'.
I have not added any configs of my own - the LSP & Sublime are using their default supplied configs.
Can anybody shed some light into this, or help me continue debugging ?

Copy-paste mistake

class LspHtmlPlugin(LanguageHandler):

Someone should write a NodeBasedLanguageHandler base class by the way. A lot of these helper packages are starting to look the same :)

How do I enable this plugin?

This is my LSP.sublime-settings that I use to enable lsp-clangd plugin

// Settings in here override those in "LSP/LSP.sublime-settings"
{
  "inhibit_snippet_completions": true,
  "show_view_status": false,
  "clients": {
    "clangd": {
      "enabled": true,
      "command": [
        "clangd", // you may use an absolute path for this clangd executable
        "-function-arg-placeholders=0",
        "-header-insertion-decorators=1",
        "-background-index",
        "-j=3",
      ],
      "scopes": ["source.c", "source.c++", "source.objc", "source.objc++"],
      "syntaxes": [
        "Packages/C++/C.sublime-syntax",
        "Packages/C++/C++.sublime-syntax",
        "Packages/Objective-C/Objective-C.sublime-syntax",
        "Packages/Objective-C/Objective-C++.sublime-syntax",
      ],
      "languageId": "cpp",
    }
  }
}

Scheme setting does not apply to shellcheck linting

When running shellcheck linting, I'm seeing the following error in the lsp log panel:

LSP-bash: 14:32:55.143 ERROR Error while linting: TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file

where the url is buffer://sublime/x. It looks like only file is supported as a scheme here. Saving as a file fixes this.

Configuration errors

Details

  • Environment variable configuration is being deprecated
  • updateConfiguration failing
  • Not string env variable not expected

In other words, there is no way to set backgroundAnalysisMaxFiles or BACKGROUND_ANALYSIS_MAX_FILES

LSP log panel

::  -> LSP-bash initialized: {}
::  -> LSP-bash workspace/didChangeConfiguration: {'settings': {'backgroundAnalysisMaxFiles': 5}}
LSP-bash: Environment variable configuration is being deprecated, please use workspace configuration. The following environment variables were used: shellcheckPath
:: <-  LSP-bash window/logMessage: {'type': 2, 'message': 'Environment variable configuration is being deprecated, please use workspace configuration. The following environment variables were used: shellcheckPath'}
:: <-- LSP-bash client/registerCapability(0): {'registrations': [{'id': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'method': 'workspace/didChangeConfiguration', 'registerOptions': {'section': 'bashIde'}}]}
:: >>> LSP-bash 0: None
:: <-- LSP-bash workspace/configuration(1): {'items': [{'section': 'bashIde'}]}
:: >>> LSP-bash 1: [None]
LSP-bash: updateConfiguration: failed with [
  {
    "code": "invalid_type",
    "expected": "object",
    "received": "null",
    "path": [],
    "message": "Expected object, received null"
  }
]
:: <-  LSP-bash window/logMessage: {'type': 2, 'message': 'updateConfiguration: failed with [\n  {\n    "code": "invalid_type",\n    "expected": "object",\n    "received": "null",\n    "path": [],\n    "message": "Expected object, received null"\n  }\n]'}

Env variable setting int

{
	"env": {
		"BACKGROUND_ANALYSIS_MAX_FILES": 0,
	},
}

Raise next error
image

Install message show redundant information

Having the README as an install message is a little weird and confusing because it gives information on how to install the package when it was just installed.

"install": "README.md"

(but I also do see that it removes some duplication of having to maintain two descriptions.)

lsp-bash server crashing

So after updating to the latest sublime version, lsp-bash seems to crash all of the time. I have gathered a diagnostic report:

Troubleshooting: LSP-bash

Version

  • LSP: 1.9.0
  • Sublime Text: 4112

Server Test Run

  • exit code: 1
  • output
/home/noah/.cache/sublime-text-3/Package Storage/LSP-bash/10.19.0/language-server/node_modules/web-tree-sitter/tree-sitter.js:1
var Module=void 0!==Module?Module:{};!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():window.TreeSitter=t()}(0,function(){var e,t={};for(e in Module)Module.hasOwnProperty(e)&&(t[e]=Module[e]);var r,n,s=[],o="./this.program",_=function(e,t){throw t},a=!1,u=!1;a="object"==typeof window,u="function"==typeof importScripts,r="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,n=!a&&!r&&!u;var i,l,d,c,m,f="";r?(f=u?require("path").dirname(f)+"/":__dirname+"/",i=function(e,t){return c||(c=require("fs")),m||(m=require("path")),e=m.normalize(e),c.readFileSync(e,t?null:"utf8")},d=function(e){var t=i(e,!0);return t.buffer||(t=new Uint8Array(t)),N(t.buffer),t},process.argv.length>1&&(o=process.argv[1].replace(/\\/g,"/")),s=process.argv.slice(2),"undefined"!=typeof module&&(module.export

TypeError: WebAssembly.Global is not a constructor
    at /home/noah/.cache/sublime-text-3/Package Storage/LSP-bash/10.19.0/language-server/node_modules/web-tree-sitter/tree-sitter.js:1:12512
    at /home/noah/.cache/sublime-text-3/Package Storage/LSP-bash/10.19.0/language-server/node_modules/web-tree-sitter/tree-sitter.js:1:144
    at Object.<anonymous> (/home/noah/.cache/sublime-text-3/Package Storage/LSP-bash/10.19.0/language-server/node_modules/web-tree-sitter/tree-sitter.js:1:170)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)

Server Configuration

  • command
[
  "${node_bin}", 
  "${server_path}", 
  "start"
]
  • shell command
/usr/bin/node "/home/noah/.cache/sublime-text-3/Package Storage/LSP-bash/10.19.0/language-server/node_modules/bash-language-server/bin/main.js" start
  • selector
(source.shell.bash)
  • priority_selector
(source.bash)
  • init_options
{}
  • settings
{}
  • env
{
  "EXPLAINSHELL_ENDPOINT": "", 
  "GLOB_PATTERN": "", 
  "HIGHLIGHT_PARSING_ERRORS": "0", 
  "PATH": "/usr/bin:/usr/bin:"
}

Active view

  • File name
/home/noah/open-source/pip/src/pip/_internal/commands/configuration.py
  • Settings
{
  "auto_complete_selector": "meta.tag, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc", 
  "lsp_active": null, 
  "syntax": "Packages/Python/Python.sublime-syntax"
}
  • base scope
source.python

Project / Workspace

  • folders
[
  "/home/noah/open-source/pip"
]
  • is project: True
  • project data:
{
  "folders": [
    {
      "path": "."
    }
  ]
}

LSP configuration

{
  "clients": {
    "bashls": {
      "enabled": true
    }, 
    "clangd": {
      "enabled": true
    }, 
    "pyls": {
      "enabled": true
    }, 
    "rust-analyzer": {
      "enabled": true
    }
  }, 
  "disabled_capabilities": [
    "completion"
  ]
}

System PATH

  • /home/noah/open-source/pip/venv/bin
  • /home/noah/.local/kitty.app/bin
  • /home/noah/.cargo/bin
  • /home/noah/.local/bin
  • /usr/local/sbin
  • /usr/local/bin
  • /usr/sbin
  • /usr/bin
  • /sbin
  • /bin
  • /usr/games
  • /usr/local/games
  • /snap/bin
  • /home/noah/open-source/fzf/bin
  • /home/noah/.local/bin
  • /home/noah/.config/composer/vendor/bin

Fresh install crash loop

Running into the following initialization error on fresh install (prompt says crash loop):

LSP-bash: internal/modules/cjs/loader.js:883
LSP-bash:   throw err;
LSP-bash:   ^
LSP-bash: 
LSP-bash: Error: Cannot find module 'node:child_process'
LSP-bash: Require stack:
LSP-bash: - /Users/<my_username>/Library/Caches/Sublime Text/Package Storage/LSP-bash/14.16.0/language-server/node_modules/bash-language-server/out/server.js
LSP-bash: - /Users/<my_username>/Library/Caches/Sublime Text/Package Storage/LSP-bash/14.16.0/language-server/node_modules/bash-language-server/out/cli.js
LSP-bash:     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
LSP-bash:     at Function.Module._load (internal/modules/cjs/loader.js:725:27)
LSP-bash:     at Module.require (internal/modules/cjs/loader.js:952:19)
LSP-bash:     at require (internal/modules/cjs/helpers.js:88:18)
LSP-bash:     at Object.<anonymous> (/Users/bli/Library/Caches/Sublime Text/Package Storage/LSP-bash/14.16.0/language-server/node_modules/bash-language-server/out/server.js:12:30)
LSP-bash:     at Module._compile (internal/modules/cjs/loader.js:1063:30)
LSP-bash:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
LSP-bash:     at Module.load (internal/modules/cjs/loader.js:928:32)
LSP-bash:     at Function.Module._load (internal/modules/cjs/loader.js:769:14)
LSP-bash:     at Module.require (internal/modules/cjs/loader.js:952:19) {
LSP-bash:   code: 'MODULE_NOT_FOUND',
LSP-bash:   requireStack: [
LSP-bash:     '/Users/<my_username>/Library/Caches/Sublime Text/Package Storage/LSP-bash/14.16.0/language-server/node_modules/bash-language-server/out/server.js',
LSP-bash:     '/Users/<my_username>/Library/Caches/Sublime Text/Package Storage/LSP-bash/14.16.0/language-server/node_modules/bash-language-server/out/cli.js'
LSP-bash:   ]
LSP-bash: }

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.