Closed parithon closed 5 years ago
@parithon thanks for working on this! Would it be possible to also include steps to test? Is it just that we need to open a file without a folder open?
@clarkio Correct. If you only had a file open and not a folder the vscode.workspace.rootPath
would be undefined and our relative paths would be inaccurate.
TLDR;
The issues occured when the user opens an individual file and not a folder (workspace). This was because we used relative paths when working with the documents instead of full paths.
Issue #44
We designed the extension to assume a workspace is always defined. This is not the case when an individual file is opened. When an individual file is opened, the
vscode.workspace.rootPath
would beundefined
which wouldn't provide the correct fileName used by theremoveHighlighter
to identify which highlight to remove.Issue #42
Additionally, because the fileName was inaccurate, the
gotoHighlightCommand
did not have a good reference to open the document. VSCode assumes the incorrect fileName should result in a request for a new document. This is why when you clicked on the highlight tree-item it would open a new document instead of switching to the existing document.Identified issue
vscode.workspace.rootPath
is undefined when a user opens an individual file and not a folder (i.e. workspace).Resolution
Changed Files
twitchHighlighterTreeview.ts
extension.ts
removeHighlighterCommand
to use the fileName parameter without any minipulation for relative paths.gotoHighlightCommand
to use the full path of the fileName instead of trying to find the file using a relative path.Addresses
42
44