Skip to content

Commit

Permalink
Merge pull request #751 from BetterThanTomorrow/fix/go_to_definition
Browse files Browse the repository at this point in the history
Fix go to definition for namespaces
  • Loading branch information
bpringe authored Aug 19, 2020
2 parents 1b6e323 + 53a3bbb commit 6052815
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Changes to Calva.

## [Unreleased]
- Fix: ["Go to definition" command fails](https://github.com/BetterThanTomorrow/calva/issues/636)
- Fix: [Weird expand selection behavior near an anonymous function](https://github.com/BetterThanTomorrow/calva/issues/600)
- Fix: [Backspace is not working properly in the output window](https://github.com/BetterThanTomorrow/calva/issues/700)

Expand Down
12 changes: 11 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function activate(context: vscode.ExtensionContext) {
}));

// Initial set of the provided contexts
vscode.commands.executeCommand("setContext", "calva:outputWindowActive", false);
outputWindow.setContextForOutputWindowActive(false);
vscode.commands.executeCommand("setContext", "calva:launching", false);
vscode.commands.executeCommand("setContext", "calva:connected", false);
vscode.commands.executeCommand("setContext", "calva:connecting", false);
Expand Down Expand Up @@ -205,6 +205,16 @@ function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(vscode.window.onDidChangeTextEditorSelection(event => {
replHistory.setReplHistoryCommandsActiveContext(event.textEditor);
}));
context.subscriptions.push(vscode.workspace.onDidCloseTextDocument(document => {
if (outputWindow.isResultsDoc(document)) {
outputWindow.setContextForOutputWindowActive(false);
}
}));
context.subscriptions.push(vscode.window.onDidChangeVisibleTextEditors(editors => {
if (!editors.some(editor => outputWindow.isResultsDoc(editor.document))) {
outputWindow.setContextForOutputWindowActive(false);
}
}));

// Clojure debug adapter setup
const provider = new debug.CalvaDebugConfigurationProvider();
Expand Down
2 changes: 1 addition & 1 deletion src/providers/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class ClojureDefinitionProvider implements vscode.DefinitionProvider {
const client = namespace.getSession(util.getFileType(document));
const info = await client.info(namespace.getNamespace(document), text);
if (info.file && info.file.length > 0) {
const pos = new vscode.Position(info.line - 1, info.column);
const pos = new vscode.Position(info.line - 1, info.column || 0);
try {
return new vscode.Location(vscode.Uri.parse(info.file, true), pos);
} catch(e) { /* ignore */ }
Expand Down
1 change: 1 addition & 0 deletions src/results-output/results-doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,5 @@ export function printStacktrace(trace: StackTrace): void {

export {
OnResultAppendedCallback,
setContextForOutputWindowActive
};

0 comments on commit 6052815

Please sign in to comment.