Skip to content

Commit

Permalink
nixd/Sema: address comments in nix-community#242
Browse files Browse the repository at this point in the history
  • Loading branch information
inclyc authored and a-kenji committed Nov 3, 2023
1 parent ae4d95e commit 87d8642
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion nixd/lib/Sema/CompletionBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,13 @@ void CompletionBuilder::addEnv(const EvalAST &AST, nix::EvalState &State,
void CompletionBuilder::addStaticEnv(const nix::SymbolTable &STable,
const nix::StaticEnv &SEnv) {
for (auto [Symbol, Displ] : SEnv.vars) {
std::string Name = STable[Symbol];

if (Name.starts_with("__"))
continue;

CompletionItem R;
R.label = STable[Symbol];
R.label = std::move(Name);
R.kind = CompletionItemKind::Constant;
addItem(std::move(R));
}
Expand Down
3 changes: 2 additions & 1 deletion nixd/lib/Server/EvalWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
#include "nixd/Support/String.h"

#include "lspserver/LSPServer.h"
#include "nixexpr.hh"

#include <llvm/ADT/StringRef.h>

#include <nix/nixexpr.hh>

namespace nixd {

EvalWorker::EvalWorker(std::unique_ptr<lspserver::InboundPort> In,
Expand Down

0 comments on commit 87d8642

Please sign in to comment.