Skip to content

Commit

Permalink
Chore: Move 'rescanProject' to onDidChangeConfiguration
Browse files Browse the repository at this point in the history
This allow the user to fix their configuration after opening the workspace. This also removes the timeout.
  • Loading branch information
idillon-sfl committed Oct 10, 2023
1 parent 5096c76 commit acb9258
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ connection.onInitialize((params): InitializeResult => {
const workspaceRoot = params.rootPath ?? ''
bitBakeProjectScanner.setProjectPath(workspaceRoot)

setTimeout(() => {
bitBakeProjectScanner.rescanProject()
}, 500)

return {
capabilities: {
textDocumentSync: TextDocumentSyncKind.Incremental,
Expand Down Expand Up @@ -80,6 +76,8 @@ connection.onDidChangeConfiguration((change) => {
bitBakeProjectScanner.pathToBuildFolder = settings.bitbake.pathToBuildFolder
bitBakeProjectScanner.pathToBitbakeFolder = settings.bitbake.pathToBitbakeFolder
bitBakeDocScanner.parse(settings.bitbake.pathToBitbakeFolder)

bitBakeProjectScanner.rescanProject()
})

connection.onDidChangeWatchedFiles((change) => {
Expand Down

0 comments on commit acb9258

Please sign in to comment.