Skip to content

Commit 0649c9e

Browse files
not-my-profileinclyc
authored andcommitted
nixd/lspserver: refactor: use Buffer for Nix blocks
1 parent 37e5672 commit 0649c9e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

nixd/lspserver/src/Connection.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ InboundPort::readDelimitedMessage(std::string &Buffer) {
249249
Buffer.clear();
250250
llvm::SmallString<128> Line;
251251
std::string NixDocURI;
252-
std::string NixDoc;
253252
while (readLine(In, Close, Line)) {
254253
auto LineRef = Line.str().trim();
255254
if (State == State::Prose) {
@@ -288,14 +287,14 @@ InboundPort::readDelimitedMessage(std::string &Buffer) {
288287
{"uri", NixDocURI},
289288
{"languageId", "nix"},
290289
{"version", 1},
291-
{"text", llvm::StringRef(NixDoc).rtrim().str()},
290+
{"text", llvm::StringRef(Buffer).rtrim().str()},
292291
},
293292
},
294293
},
295294
}};
296295
}
297-
NixDoc += Line;
298-
NixDoc += "\n";
296+
Buffer += Line;
297+
Buffer += "\n";
299298
} else {
300299
assert(false && "unreachable");
301300
}

0 commit comments

Comments
 (0)