UNPKG

smells-code-analyzer

Version:

CLI tool powered by LSP and tree-sitter for finding dead and smells code from your project

87 lines 3.68 kB
import { readFileSync } from 'fs'; export function readConfig(configPath, threshold) { const config = JSON.parse(readFileSync(configPath).toString()); return { encoding: 'ascii', lspVersion: '0.0.2', threshold: config.threshold || threshold, lspCapabilities: { textDocument: { codeAction: { dynamicRegistration: true }, codeLens: { dynamicRegistration: true }, colorProvider: { dynamicRegistration: true }, completion: { completionItem: { commitCharactersSupport: true, documentationFormat: ['markdown', 'plaintext'], snippetSupport: true, }, completionItemKind: { valueSet: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, ], }, contextSupport: true, dynamicRegistration: true, }, definition: { dynamicRegistration: true }, documentHighlight: { dynamicRegistration: true }, documentLink: { dynamicRegistration: true }, documentSymbol: { dynamicRegistration: true, symbolKind: { valueSet: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, ], }, }, formatting: { dynamicRegistration: true }, hover: { contentFormat: ['markdown', 'plaintext'], dynamicRegistration: true, }, implementation: { dynamicRegistration: true }, onTypeFormatting: { dynamicRegistration: true }, publishDiagnostics: { relatedInformation: true }, rangeFormatting: { dynamicRegistration: true }, references: { dynamicRegistration: true }, rename: { dynamicRegistration: true }, signatureHelp: { dynamicRegistration: true, signatureInformation: { documentationFormat: ['markdown', 'plaintext'], }, }, synchronization: { didSave: true, dynamicRegistration: true, willSave: true, willSaveWaitUntil: true, }, typeDefinition: { dynamicRegistration: true }, }, workspace: { applyEdit: true, configuration: true, didChangeConfiguration: { dynamicRegistration: true }, didChangeWatchedFiles: { dynamicRegistration: true }, executeCommand: { dynamicRegistration: true }, symbol: { dynamicRegistration: true, symbolKind: { valueSet: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, ], }, }, workspaceEdit: { documentChanges: true }, workspaceFolders: true, }, }, ...config, }; } //# sourceMappingURL=config.js.map