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

env BACKGROUND_ANALYSIS_MAX_FILES cannot be set #631

Closed
psydvl opened this issue Dec 15, 2022 · 1 comment · Fixed by #640
Closed

env BACKGROUND_ANALYSIS_MAX_FILES cannot be set #631

psydvl opened this issue Dec 15, 2022 · 1 comment · Fixed by #640

Comments

@psydvl
Copy link

psydvl commented Dec 15, 2022

Details

Environment variable BACKGROUND_ANALYSIS_MAX_FILES cannot be set because "Expected number, received string" error raised
bash variable are untyped, so it should be parsed as number any way

LSP-bash: /home/nixi/.cache/sublime-text/Package Storage/LSP-bash/19.1.0/language-server/node_modules/zod/lib/types.js:29
LSP-bash:         const error = new ZodError_1.ZodError(ctx.common.issues);
LSP-bash:                       ^
LSP-bash: 
LSP-bash: ZodError: [
LSP-bash:   {
LSP-bash:     "code": "invalid_type",
LSP-bash:     "expected": "number",
LSP-bash:     "received": "string",
LSP-bash:     "path": [
LSP-bash:       "backgroundAnalysisMaxFiles"
LSP-bash:     ],
LSP-bash:     "message": "Expected number, received string"
LSP-bash:   }
LSP-bash: ]
LSP-bash:     at handleResult (/home/nixi/.cache/sublime-text/Package Storage/LSP-bash/19.1.0/language-server/node_modules/zod/lib/types.js:29:23)
LSP-bash:     at ZodObject.safeParse (/home/nixi/.cache/sublime-text/Package Storage/LSP-bash/19.1.0/language-server/node_modules/zod/lib/types.js:142:16)
LSP-bash:     at ZodObject.parse (/home/nixi/.cache/sublime-text/Package Storage/LSP-bash/19.1.0/language-server/node_modules/zod/lib/types.js:122:29)
LSP-bash:     at Object.getConfigFromEnvironmentVariables (/home/nixi/.cache/sublime-text/Package Storage/LSP-bash/19.1.0/language-server/node_modules/bash-language-server/out/config.js:52:41)
LSP-bash:     at BashServer.<anonymous> (/home/nixi/.cache/sublime-text/Package Storage/LSP-bash/19.1.0/language-server/node_modules/bash-language-server/out/server.js:113:84)
LSP-bash:     at Generator.next (<anonymous>)
LSP-bash:     at /home/nixi/.cache/sublime-text/Package Storage/LSP-bash/19.1.0/language-server/node_modules/bash-language-server/out/server.js:8:71
LSP-bash:     at new Promise (<anonymous>)
LSP-bash:     at __awaiter (/home/nixi/.cache/sublime-text/Package Storage/LSP-bash/19.1.0/language-server/node_modules/bash-language-server/out/server.js:4:12)
LSP-bash:     at /home/nixi/.cache/sublime-text/Package Storage/LSP-bash/19.1.0/language-server/node_modules/bash-language-server/out/server.js:112:40 {
LSP-bash:   issues: [
LSP-bash:     {
LSP-bash:       code: 'invalid_type',
LSP-bash:       expected: 'number',
LSP-bash:       received: 'string',
LSP-bash:       path: [ 'backgroundAnalysisMaxFiles' ],
LSP-bash:       message: 'Expected number, received string'
LSP-bash:     }
LSP-bash:   ],
LSP-bash:   addIssue: [Function (anonymous)],
LSP-bash:   addIssues: [Function (anonymous)],
LSP-bash:   errors: [
LSP-bash:     {
LSP-bash:       code: 'invalid_type',
LSP-bash:       expected: 'number',
LSP-bash:       received: 'string',
LSP-bash:       path: [ 'backgroundAnalysisMaxFiles' ],
LSP-bash:       message: 'Expected number, received string'
LSP-bash:     }
LSP-bash:   ]
LSP-bash: }
LSP-bash: 
LSP-bash: Node.js v19.1.0

System info

bash-language-server version: Version is 4.1.2
node version: v19.1.0
plugin: LSP-bash 1.1.15
Editor: Sublime Text Build 4143
system: openSUSE Tumbleweed 20221212-0 x86_64

@jfcherng
Copy link
Contributor

jfcherng commented Dec 19, 2022

This should've been fixed as of LSP-bash v2.0.0 by migrating settings from "env" to "settings".
https://github.com/sublimelsp/LSP-bash/blob/2c82aacfa1df61c2e08b11144034b3e25835a3c8/LSP-bash.sublime-settings#L7-L8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants