Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

fix #2134 #2135

Merged
merged 1 commit into from
Nov 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/goSuggest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class GoCompletionItemProvider implements vscode.CompletionItemProvider {

// If no suggestions and cursor is at a dot, then check if preceeding word is a package name
// If yes, then import the package in the inputText and run gocode again to get suggestions
if (suggestions.length === 0 && lineTillCurrentPosition.endsWith('.')) {
if ((!suggestions || suggestions.length === 0) && lineTillCurrentPosition.endsWith('.')) {

let pkgPath = this.getPackagePathFromLine(lineTillCurrentPosition);
if (pkgPath.length === 1) {
Expand Down Expand Up @@ -482,7 +482,7 @@ export class GoCompletionItemProvider implements vscode.CompletionItemProvider {
let pattern = /(\w+)\.$/g;
let wordmatches = pattern.exec(line);
if (!wordmatches) {
return;
return [];
}

let [_, pkgNameFromWord] = wordmatches;
Expand Down