-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nixd/Server: split the option worker
- Loading branch information
Showing
6 changed files
with
124 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#pragma once | ||
|
||
#include "nixd/Server/Config.h" | ||
#include "nixd/Server/EvalDraftStore.h" | ||
#include "nixd/Server/IPC.h" | ||
|
||
#include "lspserver/LSPServer.h" | ||
|
||
#include <nix/value.hh> | ||
|
||
namespace nixd { | ||
|
||
class OptionWorker : public lspserver::LSPServer { | ||
private: | ||
/// The AttrSet having options, we use this for any nixpkgs options. | ||
/// nixpkgs basically defined options under "options" attrpath | ||
/// we can use this for completion (to support ALL option system) | ||
nix::Value *OptionAttrSet; | ||
std::unique_ptr<IValueEvalSession> OptionIES; | ||
|
||
public: | ||
OptionWorker(std::unique_ptr<lspserver::InboundPort> In, | ||
std::unique_ptr<lspserver::OutboundPort> Out); | ||
|
||
void onEvalOptionSet(const configuration::TopLevel::Options &Config); | ||
|
||
void onDeclaration(const ipc::AttrPathParams &, | ||
lspserver::Callback<lspserver::Location>); | ||
|
||
void onCompletion(const ipc::AttrPathParams &, | ||
lspserver::Callback<llvm::json::Value>); | ||
}; | ||
|
||
} // namespace nixd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters