further attempt for inlay hints

nix-components
pegasust 2022-12-08 07:12:55 +00:00
parent d4834a446c
commit 328df3060f
3 changed files with 5 additions and 7 deletions

View File

@ -395,7 +395,7 @@ remap('n', '<leader>gs', function() require('neogit').open({}) end);
-- LSP settings -- LSP settings
-- This function gets run when an LSP connects to a particular buffer. -- This function gets run when an LSP connects to a particular buffer.
require("inlay-hints").setup { require("inlay-hints").setup {
only_current_line = true, only_current_line = false,
eol = { eol = {
right_align = true, right_align = true,
} }
@ -440,9 +440,10 @@ local on_attach = function(client, bufnr)
nmap('<leader>wl', function() nmap('<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders())) print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, '[W]orkspace [L]ist Folders')
-- enable inlay hints if available -- enable inlay hints if available
require('inlay-hints').on_attach(client, bufnr) require('inlay-hints').on_attach(client, bufnr)
end, '[W]orkspace [L]ist Folders')
end end
-- nvim-cmp -- nvim-cmp
@ -678,7 +679,7 @@ require("rust-tools").setup {
inlay_hints = { inlay_hints = {
-- automatically set inlay hints (type hints) -- automatically set inlay hints (type hints)
-- default: true -- default: true
auto = true, auto = false,
-- Only show inlay hints for the current line -- Only show inlay hints for the current line
only_current_line = false, only_current_line = false,

View File

@ -30,7 +30,6 @@ let
proj_root = builtins.toString ./../..; proj_root = builtins.toString ./../..;
# TODO: put this in a seperate library # TODO: put this in a seperate library
# callPackage supports both PATH and function as first param! # callPackage supports both PATH and function as first param!
# TODO: support yaml string with writeTextFile (provided by callPackge)
yamlToJsonDrv = yamlContent: outputPath: pkgs.callPackage ({ runCommand }: yamlToJsonDrv = yamlContent: outputPath: pkgs.callPackage ({ runCommand }:
# runCommand source: https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/trivial-builders.nix#L33 # runCommand source: https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/trivial-builders.nix#L33
runCommand outputPath { inherit yamlContent; nativeBuildInputs = [ pkgs.yq ]; } runCommand outputPath { inherit yamlContent; nativeBuildInputs = [ pkgs.yq ]; }

View File

@ -1,8 +1,6 @@
{ {
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable"; nixpkgs.url = "nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { self, nixpkgs, ... }: outputs = { self, nixpkgs, ... }: