Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GoToDefinition opens new editor group #17

Open
josh-tepper opened this issue Jul 9, 2018 · 4 comments
Open

GoToDefinition opens new editor group #17

josh-tepper opened this issue Jul 9, 2018 · 4 comments

Comments

@josh-tepper
Copy link

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.

@mattmiller85
Copy link
Contributor

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

@mattmiller85
Copy link
Contributor

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
        })

@berickson1
Copy link

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

@mattmiller85
Copy link
Contributor

mattmiller85 commented Sep 7, 2018

@berickson1 PR submitted - #19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants