on2-dev / nasc-vscode-mac-touchbar

A customization for your the macbook pro touch bar buttons with features for VSCode.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GoToDefinition opens new editor group

josh-tepper opened this issue · comments

Even when navigating within a file, GoToDefinition opens a new editor group

My regular keybinding for "editor.action.goToDeclaration" or using >go to definition from the command pallet does not cause the behavior.

+1 this started happening for me after updating to June 2018 vscode.

FYI - I changed line 126 here by removing the optional '50' parameter and reloaded the extension and it goes to a new tab again - not a split editor:
~/.vscode/extensions/felipe.nasc-touchbar-1.11.0/extension.js

vscode.commands.executeCommand('vscode.executeDefinitionProvider',
            editor.document.uri,
            position
        ).then(result => {
            if (result[0]) {
                let found = result[0]
                var newPositionS = position.with(found.range._start.line, found.range._start.character);
                var newPositionE = position.with(found.range._end.line, found.range._end.character);
                var newSelection = new vscode.Selection(newPositionS, newPositionE);

                vscode.commands.executeCommand('vscode.open', found.uri, 50).then(result => {
                    var editor = vscode.window.activeTextEditor;
                    editor.selection = newSelection
                    vscode.commands.executeCommand('revealLine', {
                        lineNumber: newSelection.start.line,
                        at: 'center'
                    }).then(result => {
                    }, err => {
                    })
                }, err => {
                    console.log(err)
                })
            }
            return true
        })

@mattmiller85 - Would you consider putting up a PR for this extension? Hopefully the owner would take it and publish a new version

@berickson1 PR submitted - #19