Skip to content

Commit

Permalink
Adding tsplink nodes in config.tsp.json file does not load definition…
Browse files Browse the repository at this point in the history
…s for added node lua table (#20)

Default value of the Lua.workspace.ignoreDir configuration list contains
.vscode folder
Since .vscode folder stores generated node table details its getting
ignored by default

Making Lua.workspace.ignoreDir configuration as empty list for workspace
setting

---------

Co-authored-by: esarver <[email protected]>
  • Loading branch information
jharajeev55 and esarver authored May 9, 2024
1 parent 3341ea4 commit 70a5e8e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

- Corrected extension description
- Remove `:` from port number
- Adding tsplink nodes in config.tsp.json file does not load definitions for added node lua table
- Changed literal `\` to `path.join()` when populating config.tsp.json
- Remove debugger-related items from `package.json`
- **tsp-toolkit-kic-cli:** Fix issue where unrecognized model number causes kic-cli to never exit (TSP-645)
- **tsp-toolkit-kic-cli:** Fix issue in which the prompt would be displayed immediately after loading a script


## [0.15.2]

### Fixed
Expand Down
35 changes: 35 additions & 0 deletions src/workspaceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,40 @@ function disableDiagnosticForLibraryFiles(
)
}

/**
* Configure empty list to Lua.workspace.ignoreDir
* @param workspace_path workspace folder path
*/
function setEmptyLuaWorkspaceIgnoreDirList(
workspace_path: vscode.WorkspaceFolder
) {
const configuration = vscode.workspace.getConfiguration(
undefined,
workspace_path.uri
)
configuration
.update(
"Lua.workspace.ignoreDir",
[],
vscode.ConfigurationTarget.WorkspaceFolder
)
.then(
() => {
// Configuration updated successfully
void vscode.window.showInformationMessage(
"Lua.workspace.ignoreDir configuration updated"
)
},
(error) => {
// Error occurred while updating the configuration
void vscode.window.showInformationMessage(
"Failed to update Lua.workspace.ignoreDir configuration:",
error
)
}
)
}

/**
* Iterate over workspace folder to find file with .tsp extension
*/
Expand All @@ -181,6 +215,7 @@ export async function processWorkspaceFolders() {
if (await processFiles(folderPath)) {
updateFileAssociations()
disableDiagnosticForLibraryFiles(folder)
setEmptyLuaWorkspaceIgnoreDirList(folder)
createTspFileFolder(folderPath)
}
}
Expand Down

0 comments on commit 70a5e8e

Please sign in to comment.