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

Completion for pkg path inside strings #340

Merged
merged 8 commits into from
Feb 27, 2021

Conversation

TwitchBronBron
Copy link
Member

Notable Changes:

  • Show completions for file paths inside strings when they start with pkg: or libpkg:.
  • don't show completions inside of a string (expect for the pkg: and libpkg: changes mentioned above)

I couldn't get this to auto-show the completions while typing. so you have to manually activate the intellisense menu using a keyboard shortcut or the command pallet.

6e9c0583-4288-489e-85ba-5668a3e57c45

fixes #333
fixes #228

src/LanguageServer.ts Outdated Show resolved Hide resolved
src/LanguageServer.ts Outdated Show resolved Hide resolved
const [, openingQuote, fileProtocol] = match;
//include every absolute file path from this scope
for (const file of scope.getAllFiles()) {
const pkgPath = `${fileProtocol}:/${file.pkgPath.replace(/\\/g, '/')}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkgPath is supposed to be normalised already no? Seems like a waste.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until #329 merges, pkgPath uses windows separators on windows, and unix separators everywhere else. So this is absolutely necessary right now.

@TwitchBronBron TwitchBronBron merged commit e46f817 into master Feb 27, 2021
@TwitchBronBron TwitchBronBron deleted the pkg-completion-in-strings branch February 27, 2021 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants