nixd
Loading...
Searching...
No Matches
PackAttrs.h File Reference

Code action for packing dotted attribute paths into nested sets. More...

#include <lspserver/Protocol.h>
#include <nixf/Sema/ParentMap.h>
#include <llvm/ADT/StringRef.h>
#include <string>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  nixf
namespace  nixd

Functions

void nixd::addPackAttrsAction (const nixf::Node &N, const nixf::ParentMapAnalysis &PM, const std::string &FileURI, llvm::StringRef Src, std::vector< lspserver::CodeAction > &Actions)
 Add pack action for dotted attribute paths.

Detailed Description

Code action for packing dotted attribute paths into nested sets.

Transforms: { foo.bar = 1; } -> { foo = { bar = 1; }; } Also offers bulk pack when siblings share a prefix: { foo.bar = 1; foo.baz = 2; } -> { foo = { bar = 1; baz = 2; }; }

Definition in file PackAttrs.h.