rcjsuen / dockerfile-language-service

Dockerfile language service for providing an API to create feature-rich Dockerfile editors in JavaScript.
MIT License
16 stars 2 forks source link

Hover cannot be displayed for an instruction keyword that spans multiple lines #59

Closed rcjsuen closed 4 years ago

rcjsuen commented 4 years ago
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?

No one will create the above Dockerfile but it is valid despite the empty continuation line. All that extra space should be collapsed into a FROM but we're not accounting for this in the hover code.

import { DockerfileLanguageServiceFactory } from 'dockerfile-language-service';
const service = DockerfileLanguageServiceFactory.createLanguageService();
const hover = service.computeHover("FR\\\n\nOM scratch", { line: 0, character: 1 });
console.log(hover);
undefined