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

Adopt version 0.0.17 of the language server #249

Merged
merged 1 commit into from
May 7, 2018

Conversation

rcjsuen
Copy link
Contributor

@rcjsuen rcjsuen commented Apr 14, 2018

Previously, version 0.0.14 was adopted in #233 but two bugs were discovered that caused the change to be reverted. These two issues have now been fixed in 0.0.17.

Two other issues (#237 and #238) unrelated to the 0.0.14 upgrade were reported and they have also been implemented and fixed. And of course, #218 that was fixed in 0.0.14 has not regressed and is fixed in 0.0.17.

Please use the following Dockerfile to test the update to 0.0.17 from 0.0.13. Thank you!

#escape=`
###################################################
### changes from version 0.0.14
###################################################
# it should be possible to Ctrl+Click node and jump to its site on Docker Hub
FROM node
# it should be possible to Ctrl+Click microsoft/dotnet and jump to its site on Docker Hub
FROM microsoft/dotnet
# hover over ARG, it should state that it was added in Docker 1.9
ARG x=y
RUN `
# there should be code actions to remove these empty lines
            
            
            `
            
       ls

# 5s-10ms is an invalid duration, it should be flagged as an error
HEALTHCHECK --interval=5s-10ms CMD ls
# 5s.1ms is a valid duration, it should NOT be flagged as an error
HEALTHCHECK --timeout=5s.1ms CMD ls

# the last argument of a multiargument ADD/COPY must be a directory, z/ or z\
ADD x y z
COPY x y z
# ok
ADD x y z/
COPY x y z/
# ok
ADD x y z\
COPY x y z\

# these digests and tags are all invalid, should be flagged as errors
FROM alpine@
FROM alpine@sha25:x
FROM alpine:
FROM alpine:^
FROM alpine:a66^

# hover over STOPSIGNAL, it says it was added in 1.12 when it should be 1.9
STOPSIGNAL 9
ARG FTP_PROXY
# invoke Intellisense here
# you shouldn't get two capitalized $FTP_PROXY entries
RUN $FTP

FROM scratch
ENV FTP_ABC=y
FROM alpine
# invoke Intellisense here, $FTP_ABC should not be suggested as
# it's a variable from another build stage
RUN echo $F

# $ is an invalid kill code and should be an error
STOPSIGNAL $

# all these instructions are in a different build stage and
# should not be flagged as duplicates as errors
# this fixes issue 218
# https://github.com/Microsoft/vscode-docker/issues/218
FROM alpine
HEALTHCHECK CMD ls
ENTRYPOINT ls
CMD ls
FROM alpine
ENTRYPOINT pwd
CMD pwd
HEALTHCHECK CMD pwd

# trigger parameter hints with Ctrl+Shift+Space after the S in AS
# hit the down key to look at the 2/3 and 3/3 suggestions
# and you will see that the underlined parameter
# is not the AS and is incorrect
FROM node AS

###################################################
### changes from version 0.0.15, 0.0.16, and 0.0.17
###################################################

# JSON cannot be in single quotes, reported by #238
# https://github.com/Microsoft/vscode-docker/issues/238
# default severity as warning, can be toggled
# "docker.languageserver.diagnostics.instructionJSONInSingleQuotes": "warning",
# "docker.languageserver.diagnostics.instructionJSONInSingleQuotes": "error",
# "docker.languageserver.diagnostics.instructionJSONInSingleQuotes": "ignore",
ADD ['x', 'y']
CMD ['x', 'y']
COPY ['x', 'y']
ENTRYPOINT ['x', 'y']
RUN ['x', 'y']
VOLUME ['x', 'y']

# invalid time units
FROM alpine
HEALTHCHECK --interval=5-5s CMD ls
FROM alpine
HEALTHCHECK --timeout=5..5s CMD ls
FROM alpine
HEALTHCHECK --timeout=--5s CMD ls

# validation should parse JSON properly and consider the last JSON string
COPY [ "t1.txt", "t2.txt", "./" ]
ADD [ "t1.txt", "t2.txt", "./" ]

# Docker engine will ignore stuff after the JSON, Docker will build this
# even though it looks wrong so the validator will ignore it too to match
# the behaviour
SHELL [ "bin/sh" ] ]

# validation should parse JSON properly and consider this JSON string
# as multiple arguments even though it's "one" argument word-wise
ADD ["t1.txt","t2.txt"]
COPY ["t1.txt","t2.txt"]

# sample file given in https://github.com/rcjsuen/dockerfile-language-server-nodejs/issues/216
# delete /tmp with the backspace character, and then Ctrl+Z
# no parsing errors should appear
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAVA_OPTS
ENV JAVA_OPTS=$JAVA_OPTS
ADD stickerapp.jar stickerapp.jar
EXPOSE 3000
ENTRYPOINT exec java $JAVA_OPTS -jar stickerapp.jar
# For Spring-Boot project, use the entrypoint below to reduce Tomcat startup time.
#ENTRYPOINT exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar stickerapp.jar

This update to 0.0.17 from 0.0.13 includes many features and bug
fixes.

The update includes changes to how workspace/configuration requests
are handled as they have become a part of the official LSP
specification.

textDocument/documentLink requests are now handled by creating links
for image names that open to hub.docker.com.

Signed-off-by: Remy Suen <[email protected]>
@rcjsuen rcjsuen changed the title Adopt version 0.0.16 of the language server Adopt version 0.0.17 of the language server Apr 16, 2018
@Tadimsky Tadimsky mentioned this pull request May 7, 2018
@chrisdias chrisdias merged commit b1f9bc1 into microsoft:master May 7, 2018
@rcjsuen rcjsuen deleted the lsp-0.0.16 branch May 7, 2018 19:01
@microsoft microsoft locked and limited conversation to collaborators Oct 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants