-
Notifications
You must be signed in to change notification settings - Fork 38
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
trigger workspace/didChangeConfiguration on compilation database modification #76
base: master
Are you sure you want to change the base?
Conversation
75c2916
to
1fc7768
Compare
Done. Could you please explain me the rationale between using single or double quotes? Both seem to be used in the code so I'd like to know when each one has to be used in the case I have other modification to make |
When can this be merged? |
If the initialization option // ccls/src/project.cc
cdbDir = root;
if (g_config->compilationDatabaseDirectory.size()) {
if (sys::path::is_absolute(g_config->compilationDatabaseDirectory))
cdbDir = g_config->compilationDatabaseDirectory;
else
sys::path::append(cdbDir, g_config->compilationDatabaseDirectory);
}
sys::path::append(path, cdbDir, "compile_commands.json"); |
That should do it |
src/serverContext.ts
Outdated
|
||
if (config.get('index.reloadDatabaseOnChange', true)) { | ||
let db_dir = config.get('misc.compilationDatabaseDirectory'); | ||
if (!db_dir || db_dir === '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete the surrounding {}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok of you prefer it that way
src/serverContext.ts
Outdated
if (!db_dir || db_dir === '') { | ||
db_dir = this.cwd; | ||
} | ||
const db_watcher = workspace.createFileSystemWatcher(db_dir + "/compile_commands.json", false, false, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"
-> '
I think single quotes are generally preferred, but for some historical reasons double quotes are still used in these files...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't be better to change all quotes in the project once and for all and stick to that?
Is it ok now? |
This allows to disable CodeLens extension-wise. Some users may want to see CodeLens provided by other extensions, thus they do not want to disable CodeLens globally.
…ocket endpoint (MaskRay#51) This can be used with lsp-inspector-webview (https://marketplace.visualstudio.com/items?itemName=octref.lsp-inspector-webview) for easier debugging.
Populate ClientConfig with all keys from VS Code WorkspaceConfiguration (except those in blacklist) instead of a preset list. With this change, it is possible to send initializationOptions to ccls even if there is no corresponding configuration declaration in package.json. So new initializationOption exposed in ccls no longer necessarily reuqires an update of vscode-ccls. Declarations in package.json are still useful as they still provide documentations and default values. Also no longer add workspaceSymbol.sort = false by default as this works poorly when there are too many symbols.
const defaults = { cwd: undefined, env: process.env };
now it shows names of fields as well as their types + byte offset of particular field in the tooltip
… call hierarchy Defaults to true.
Adopt the emacs-ccls approach. ccls.highlight.{function,type,type}.face define faces of basic symbol kinds from which other symbol kinds ({member,staticMember}{Function,Variable}, etc) can inherit. For example, if ccls.highlight.function.face: ["enabled"] is specified, memberFunction will also be enabled because of the default configurations: // Inherit from both ccls.highlight.{function,member}.face ccls.highlight.memberFunction.face: ["function", "member"] ccls.highlight.member.face: ["fontStyle: italic"] For a symbol kind, its face property takes effect if "enabled" is specified.
Watching a symlink instead of the target file won't actually trigger a db reloading if the symlinked file changes
Looks like this somehow picked up commits from master? |
Should this be rebased to be merged? |
I was annoyed to always have to call
Restart language server
orRestart language server in lazy mode
manually when my compilation database was modified so here is my attempt to fix this.I simply use
workspace.createFileSystemWatcher
to monitor changes to thecompilation_database.json
file and when a change occur, I send theworkspace/didChangeConfiguration
notification to the server.It seems to be working for me but since it's the first time I work on a VSCode extension I might have missed a couple things.