diff --git a/nixd/lib/Syntax/Parser/Parser.y b/nixd/lib/Syntax/Parser/Parser.y index a480488e2..e7ea5be7e 100644 --- a/nixd/lib/Syntax/Parser/Parser.y +++ b/nixd/lib/Syntax/Parser/Parser.y @@ -401,6 +401,12 @@ uri : URI { $$ = decorateNode(new nixd::syntax::URI, *yylocp, *Data); $$->S = std::string($1); + + Diagnostic Diag; + Diag.Msg = "URL literal is deprecated"; + Diag.Kind = Diagnostic::Warning; + Diag.Range = $$->Range; + Data->Diags.emplace_back(std::move(Diag)); } identifier_or diff --git a/nixd/tools/nixd-lint/test/url-literal.nix b/nixd/tools/nixd-lint/test/url-literal.nix new file mode 100644 index 000000000..cbd648c45 --- /dev/null +++ b/nixd/tools/nixd-lint/test/url-literal.nix @@ -0,0 +1,5 @@ +# RUN: nixd-lint %s | FileCheck %s +{ + # CHECK: warning: URL literal is deprecated + bar = http://1.1.1.1; +}