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

Incorrect completion suggestions returned for an instruction keyword that spans multiple lines #60

Closed
rcjsuen opened this issue Mar 7, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Mar 7, 2020

FR\

OM scratch
$ docker build .
Sending build context to Docker daemon  38.15MB
[WARNING]: Empty continuation line found in:
    FROM scratch
[WARNING]: Empty continuation lines will become errors in a future release.
Step 1/1 : FROM scratch
 ---> 
No image was generated. Is your Dockerfile empty?

Although the strange text should be combined to form a single word FROM, our content assist processor does not appear to be accounting for this and returns the wrong completion items if we try to ask it for items on the third line.

import { DockerfileLanguageServiceFactory } from 'dockerfile-language-service';
const service = DockerfileLanguageServiceFactory.createLanguageService();
const items = service.computeCompletionItems(
    "FR\\\n\nOM scratch",
    { line: 2, character: 1 }
);
console.log(items);
[ { data: 'ONBUILD',
    textEdit: { range: [Object], newText: 'ONBUILD' },
    label: 'ONBUILD',
    kind: 14,
    insertTextFormat: 1 } ]

The code should be considering FRO instead of O for its prefix.

@rcjsuen rcjsuen added the bug Something isn't working label Mar 7, 2020
@rcjsuen rcjsuen self-assigned this Mar 7, 2020
rcjsuen added a commit that referenced this issue Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant