GithubHelp home page GithubHelp logo

lintplus's Introduction

lint+

An improved linting plugin for Lite XL.

Includes compatibility layer for linter.

Screenshots

1st screenshot

Features ErrorLens-style warnings and error messages for quickly scanning through code for errors.


2nd screenshot

The status view shows either the first error, or the full message of the error under your text cursor. No mouse interaction needed!

Motivation

There were a few problems I had with the existing linter plugin:

  • It can only show "warnings" - there's no severity levels (info/hint/warning/error).
  • It doesn't show the messages after lines (ErrorLens style), you have to hover over the warning first.
  • It spam-runs the linter command, but Nim (and possibly other languages) compiles relatively slowly, which lags the editor to hell.
  • It doesn't display the first or current error message on the status view.

lint+ aims to fix all of the above problems.

Why not just fix linter?

  • It works fundamentally differently from lint+, so fixing it would be more costly than just making a new plugin.
  • I haven't ever made my own linter support plugin, so this was a good exercise.

Installation

Navigate to your plugins folder, and clone the repository:

$ git clone https://github.com/liquidev/lintplus

To enable the different linters available on the linters subdirectory, you have to load them on your lite-xl user module file (init.lua).

You can load a single linter:

local lintplus = require "plugins.lintplus"
lintplus.load("luacheck")

or multiple linters by passing a table:

local lintplus = require "plugins.lintplus"
lintplus.load({"php", "luacheck"})

If you want to use plugins designed for the other linter, you will also need to enable the compatibility plugin linter.lua from this repository.

$ ln -s $PWD/{lintplus/linter,linter}.lua

Keep in mind that plugins designed for linter will not work as well as lint+ plugins, because of linter's lack of multiple severity levels. All warnings reported by linter linters will be reported with the warning level.

Automatic Linting

To enable automatic linting upon opening/saving a file, add the following code tou your lite-xl user module:

local lintplus = require "plugins.lintplus"
lintplus.setup.lint_on_doc_load()
lintplus.setup.lint_on_doc_save()

This overrides Doc.load and Doc.save with some extra behavior to enable automatic linting.

Commands

Available commands from the lite-xl commands palette (ctrl+shift+p):

  • lint+:check - run the appropriate linter command for the current document
  • lint+:goto-previous-message (alt+up) - jump to previous message on current document
  • lint+:goto-next-message (alt+down) - jump to next message on current document

Configuration

lint+ itself looks for the following configuration options:

  • config.lint.kind_pretty_names
    • table:
      • info: string = "I"
      • hint: string = "H"
      • warning: string = "W"
      • error: string = "E"
    • controls the prefix prepended to messages displayed on the status bar. for example, setting error to Error will display Error: … or line 10 Error: … instead of E: … or line 10 E: ….
  • config.lint.lens_style
    • string:
      • "blank": do not draw underline on line messages
      • "solid": draw single line underline on line messages (default)
      • "dots": draw dotted underline on line messages (slower performance)
    • function(x, y, width, color): a custom drawing routine
      • x: number
      • y: number
      • width: number
      • color: renderer.color

All options are unset (nil) by default, so eg. setting config.lint.kind_pretty_names.hint will not work because config.lint.kind_pretty_names does not exist.

Individual plugins may also look for options in the config.lint table. Refer to each plugin's source code for more information.

Styling

The screenshots above use a theme with extra colors for the linter's messages. The default color is the same color used for literals, which isn't always what you want. Most of the time you want to have some clear visual distinction between severity levels, so lint+ is fully stylable.

  • style.lint
    • table:
      • info: Color - the color used for infos
      • hint: Color - the color used for hints
      • warning: Color - the color used for warnings
      • error: Color - the color used for errors

Example:

local common = require "core.common"
local style = require "core.style"
style.lint = {
  info = style.syntax["keyword2"],
  hint = style.syntax["function"],
  warning = style.syntax["function"],
  error = { common.color "#FF3333" }
}

As with config, you need to provide all or no colors.

Creating new linters

Just like linter, lint+ allows you to create new linters for languages not supported out of the box. The API is very simple:

Severity: enum {
  "info",     -- suggestions on how to fix things, may be used in tandem with
              -- other messages
  "hint",     -- suggestions on small things that don't affect program behavior
  "warning",  -- warnings about possible mistakes that may affect behavior
  "error",    -- syntax or semantic errors that prevent compilation
}

LintContext: table {
  :gutter_rail(): number
    -- creates a new gutter rail and returns its index
  :gutter_rail_count(): number
    -- returns how many gutter rails have been created in this context
  -- You may create additional fields in this table, but keys prefixed with _
  -- are reserved by lint+.
}

lintplus.add(linter_name: string)(linter: table {
  filename: pattern,
  procedure: table {
    command: function (filename: string): {string},
      -- Returns the lint command for the given filename.
    interpreter: (function (filename, line: string, context: LintContext):
      function ():
        nil or
        (filename: string, line, column: number,
         kind: Severity, message: string, rail: number or nil)) or "bail"
      -- Creates and returns a message iterator, which yields all messages
      -- from the line.
      -- If the return value is "bail", reading the lint command is aborted
      -- immediately. This is done as a mitigation for processes that may take
      -- too long to execute or block indefinitely.
      -- `rail` is optional and specifies the gutter rail to which the message
      -- should be attached.
  }
})

Because writing command and interpreter functions can quickly get tedious, there are some helpers that return pre-built functions for you:

lintplus.command(cmd: {string}): function (string): {string}
  -- Returns a function that replaces `lintplus.filename` in the given table
  -- with the linted file's name.
lintplus.interpreter(spec: table {
  info: pattern or nil,
  hint: pattern or nil,
  warning: pattern or nil,
  error: pattern or nil,
    -- Defines patterns for all the severity levels. Each pattern must have
    -- four captures: the first one being the filename, the second and third
    -- being the line and column, and the fourth being the message.
    -- When any of these are nil, the interpreter simply will not produce the
    -- given severity levels.
  strip: pattern or nil,
    -- Defines a pattern for stripping unnecessary information from the message
    -- capture from one of the previously defined patterns. When this is `nil`,
    -- nothing is stripped and the message remains as-is.
})

An example linter built with these primitives:

lintplus.add("nim") {
  filename = "%.nim$",
  procedure = {
    command = lintplus.command {
      "nim", "check", "--listFullPaths", "--stdout", lintplus.filename
    },
    interpreter = lintplus.interpreter {
      -- The format for these three in Nim is almost exactly the same:
      hint = "(.-)%((%d+), (%d+)%) Hint: (.+)",
      warning = "(.-)%((%d+), (%d+)%) Warning: (.+)",
      error = "(.-)%((%d+), (%d+)%) Error: (.+)",
      -- We want to strip annotations like [XDeclaredButNotUsed] from the end:
      strip = "%s%[%w+%]$",
      -- Note that info was omitted. This is because all of the severity levels
      -- are optional, so eg. you don't have to provide an info pattern.
    },
  },
}

If you want to let the user of your linter specify some extra arguments, lintplus.args_command can be used instead of lintplus.command:

-- ...
    command = lintplus.args_command(
      { "luacheck",
        lintplus.args,
        "--formatter=visual_studio",
        lintplus.filename },
      "luacheck_args"
    )
-- ...

To enable plugins for different languages, do the same thing, but with lintplus_*.lua. For example, to enable support for Nim and Rust: The second argument to this function is the name of the field in the config.lint table. Then, the user provides arguments like so:

config.lint.luacheck_args = { "--max-line-length=80", "--std=love" }

Known problems

  • Due to the fact that it shows the most severe message at the end of the line, displaying more than one message per line is really difficult with the limited horizontal real estate, so it can only display one message per line.
  • It is unable to underline the offending token, simply because some linter error messages do not contain enough information about where the error start and end is. It will highlight the correct line and column, though.

lintplus's People

Contributors

andre-la avatar guldoman avatar jgmdev avatar liquidev avatar merlindiavova avatar swissalps avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lintplus's Issues

lint command lags the editor nonetheless

what a shame.

Well this is caused by the fact that the lint command still runs on the main thread. The proper way of solving this would be writing a Nim .dll/.so that would be loaded using package.loadlib in Lua. This library would provide some rudimentary IPC facilities, such as starting a new process and calling a callback once it's complete.

understanding self.popen:read_stdout(1)

[Windows user]

I'm attempting to create a fresh TypeScript configuration using the ESLint module, but despite my efforts, the process consistently gets caught in an infinite loop.

My understanding is that the read_stdout(1) function should only return a single byte. However, it appears to be returning the whole output and "callback(line)" never gets executed.

Captură de ecran 2024-02-10 153421

I am currently stucked at this, and I don't know what I'm doing wrong

BUG: `lint+` impedes file opening in Lite XL 2.1.3

After opening Lite XL 2.1.3 with the lintplus plugin installed and the following configuration options in the init.lua:

local lintplus = require "plugins.lintplus"
lintplus.setup.lint_on_doc_load()  -- enable automatic linting upon opening a file
lintplus.setup.lint_on_doc_save()  -- enable automatic linting upon saving a file
lintplus.load({"luacheck", "shellcheck", "python", "lacheck"})

this is the error that Lite XL outputs:
image

and this is the stacktrace:

Sun Feb 18 12:52:33 2024 [ERROR] Error creating child process: No such file or directory at /usr/share/lite-xl/core/init.lua:1227

stack traceback:
[C]: in function 'process.start'
/home/raffaele/.config/lite-xl/plugins/lintplus/liteipc.lua:10: in function 'plugins.lintplus.liteipc.start_process'
/home/raffaele/.config/lite-xl/plugins/lintplus/init.lua:251: in function 'plugins.lintplus.check'
/home/raffaele/.config/lite-xl/plugins/lintplus/init.lua:853: in upvalue 'load'
/usr/share/lite-xl/plugins/autoreload.lua:113: in upvalue 'doc_load'
/home/raffaele/.config/lite-xl/plugins/scm/init.lua:647: in upvalue 'doc_load'
/home/raffaele/.config/lite-xl/plugins/lintplus/init.lua:850: in function 'core.doc.load'
/usr/share/lite-xl/core/doc/init.lua:27: in upvalue 'new'
/usr/share/lite-xl/plugins/detectindent.lua:280: in upvalue 'doc_new'
/home/raffaele/.config/lite-xl/plugins/lsp_snippets.lua:612: in upvalue 'doc_new'
...(skipping 16 levels)
/usr/share/lite-xl/core/keymap.lua:267: in function 'core.keymap.on_mouse_pressed'
/usr/share/lite-xl/core/init.lua:1254: in upvalue 'on_event'
/usr/share/lite-xl/plugins/macro.lua:19: in function 'core.on_event'
[C]: in function 'xpcall'
/usr/share/lite-xl/core/init.lua:1226: in function 'core.try'
/usr/share/lite-xl/core/init.lua:1314: in function 'core.step'
/usr/share/lite-xl/core/init.lua:1404: in upvalue 'core_run'
/home/raffaele/.config/lite-xl/plugins/settings.lua:1896: in function 'core.run'
(...tail calls...)
[string "local core..."]:14: in function <[string "local core..."]:6>
[C]: in function 'xpcall'
[string "local core..."]:6: in main chunk

build-liteipc.sh uses shell-specific functions not available in standard sh

pushd and popd are shell-specific functions not available to standard sh itself, so possible solutions are to either require bash specifically in the shebang line or the better but sadly less elegant, replace them with cd calls to make it work in just about any shell. Otherwise it will require edits on any distro that doesn't switch sh to another shell, which still seems to be relatively common, unfortunately.

npm and other commands from Windows

Executing npm modules as separate processes on Windows requires including their file extensions. For example, "eslint" should be "eslint.cmd".

The solution would look like this:

function lint.command(cmd)

   vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  if PLATFORM == "Windows" then
    table.insert(cmd, 1, "/C")
    table.insert(cmd, 1, "cmd.exe")
  end
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  return function (filename)
    return map(cmd, function (k, v)
      if type(k) == "number" and v == lint.filename then
        return filename
      end
      return v
    end)
  end
end

However, I believe encapsulating all Windows commands after "cmd.exe /C" without offering an option within the linter script to bypass this encapsulation isn't the most effective approach. Additionally, there's currently no way to send something like 'windows_skip_cmd' flag to customize the command's construction, without breaking changes.

Lint+ doesn't work on Windows

Hello!
Today I decided instead of Linter plugin to start using Lint+. But I'm experiencing some problems with it.
When I try to lint something then I got this error:
lintplus_error

Lintplus is not working in linux

I am new to lint-xl and I am trying out your plugin. I want a linter for python and rust, and I have flake8 already installed in my system. I have cloned(git clone) this repo inside ~/.config/lite-xl/plugins/ and added

local lintplus = require "plugins.lintplus"
lintplus.setup.lint_on_doc_load()
lintplus.setup.lint_on_doc_save()

to my init.lua file. But when I open my python and rust files, I see no linting? I tried Lint+: Check returns this error

No linter available for the given filetype

lite-xl : 2.0.5 appimage

Python linter flake8

i see no linter for python any way to build it plz guide or you can show me one

[Lite XL 2.0.2] Logs and JS files don't work in async mode

At first, I tried to rewrite the linter for JS, but it did not work in any way, and I thought that it was in synchronous mode (the plugin itself works, I checked it). When I try to open a JS file or simply open logs, it throws an error. In the first case, I attach a screenshot, in the second it just throws "Tried to add view to locked node". Most likely I made a mistake in the installation, but I can't say for sure.
error

[Litexl] Lintplus causing files to fail to open when lacking a linter submodule

Hi, currently lintplus seems to be causing files to refuse to open when they do not have an available linter on a recent git clone of litexl. The stracktrace is as follows:

(forgive any typos, I had to transcribe this by hand because I cannot for the life of me find the actual log file or a way to copy the contents of the log pane)

/opt/litexl/data/plugins/lintplus.lua:253: attempt to index local 'linter' (a nil value) at /opt/litexl/data/core/init.lua:799
stack traceback:
/opt/litexl/data/plugins/lintplus.lua:253: in function 'init_linter_for_doc'
/opt/litexl/data/plugins/lintplus.lua:265: in function 'load'
/opt/litexl/data/plugins/autoreload.lua:53: in function 'load'
/opt/litexl/data/core/doc/init.lua:42: in function 'new'
/opt/litexl/data/plugins/detectindent.lua:123: in function 'new'
/opt/litexl/data/core/object.lua:53: in function 'Doc'
/opt/litexl/data/core/init.lua:747: in function 'open_doc'
/opt/litexl/data/plugins/treeview.lua:222: in function </opt/litexl/data/plugins/treeview.lua:220>
[C]: in function 'xpcall'
/opt/litexl/data/core/init.lua:798: in function 'try'
/opt/litexl/data/plugins/treeview.lua:220: in function 'on_mouse_pressed'
/opt/litexl/data/core/rootview.lua:604: in function 'on_mouse_pressed'
/opt/litexl/data/core/init.lua:821: in function 'on_event'
/opt/litexl/data/plugins/macro.lua:19: in function </opt/litexl/data/plugins/macro.lua:18>
[C]: in function 'xpcall'
/opt/litexl/data/core/init.lua:798: in function 'try'
/opt/litexl/data/core/init.lua:878: in function 'step'
/opt/litexl/data/core/init.lua:958 in function </opt/litexl/data/core/init.lua:954>
(...tail calls...)
[string 'local core..."]:9: in function <[string "local core...']:2>
[C]: in function 'xpcall'
[string "local core..."]:2: in main chunk

lint+/luacheck init.lua: linter exited with signal 255

So recently I've tried installing and configuring the linterplus plugin and I faced a weird problem: When I execute the Lint+:Check command, nothing happens. Also when I try the plugin on different languages such as python, rust, php it shows me that linter for them does not exist

Here are the logs:

Fri Sep  8 09:59:43 2023 [INFO] lint+/luacheck: init.lua: linter exited with signal 255 at /home/*/.config/lite-xl/plugins/lintplus/init.lua:241

Here is my config from main init.lua:

--Linter 
local lintplus = require "plugins.lintplus"
lintplus.load({"luacheck", "php", "python", "rust"}) 
lintplus.setup.lint_on_doc_load()
lintplus.setup.lint_on_doc_save()  

Error creating a process: 2.

Hi guys. I would first like to apologise in advance if this seems to be a stupid issue to open as I am a complete noob in the programming world. Basically, I was setting up an LSP and linter for python. Followed the installation guides and it seemed to be going well since the LSP server connects but after that, this happens:
lite-xl (2)
What did I do wrong?

Problem installing plugin

Hi i am having trouble installing the plugin. Especially at this step
You may also want to add this to your user/init.lua to enable automatic linting upon opening/saving a file: i can't find the file user/init.lua the closest thing to it is core/init.lua and when I do paste the code in it and try to run lite_xl i get an error from the text editor. Not only that when I symlinked the lintplus_nim.lua file i get an error about version number not being the same with the compiler's version number

Use Lite XL 2.0's `process` API

After Lite XL 2.0 is released, the liteipc Rust library should be removed in favor of the process library built into the editor. Compatibility with vanilla lite can be preserved by providing a polyfill based on the current implementation of synchronous liteipc, but I don't really see many reasons for supporting the inferior vanilla version of the editor.

rust lint does not work on windows

image
managed to get this in the log file. the linter does not display anything at all.

for context, file (in a cargo project):

#![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]

mod test;

fn main() {
    println!("Hello, world!");
    let x: u64 = 6186491_8973511;
    print!("{}", x);
    let x = [3, 4, 5];
    let y: [u8; 3] = x.map(|x| x*3);
    println!("{:?}", y);
    let z = "this is a relatively long string, to see the diff between strings and code.";
    let a = "test";
    test::tree::printlol();
}
// fn main() {
//     for argument in std::env::args() {
//         println!("{argument:?}");
//     }
// }

error output:

{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: use of `println!`\n --> src\\main.rs:6:5\n  |\n6 |     println!(\"Hello, world!\");\n  |     ^^^^^^^^^^^^^^^^^^^^^^^^^\n  |\nnote: the lint level is defined here\n --> src\\main.rs:1:9\n  |\n1 | #![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]\n  |         ^^^^^^^^^^^^^^^^^^^\n  = note: `#[warn(clippy::print_stdout)]` implied by `#[warn(clippy::restriction)]`\n  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout\n\n","children":[{"children":[],"code":null,"level":"note","message":"the lint level is defined here","rendered":null,"spans":[{"byte_end":27,"byte_start":8,"column_end":28,"column_start":9,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":28,"highlight_start":9,"text":"#![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]"}]}]},{"children":[],"code":null,"level":"note","message":"`#[warn(clippy::print_stdout)]` implied by `#[warn(clippy::restriction)]`","rendered":null,"spans":[]},{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout","rendered":null,"spans":[]}],"code":{"code":"clippy::print_stdout","explanation":null},"level":"warning","message":"use of `println!`","spans":[{"byte_end":133,"byte_start":108,"column_end":30,"column_start":5,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":6,"line_start":6,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":30,"highlight_start":5,"text":"    println!(\"Hello, world!\");"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: use of `print!`\n --> src\\main.rs:8:5\n  |\n8 |     print!(\"{}\", x);\n  |     ^^^^^^^^^^^^^^^\n  |\n  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout\n\n","children":[{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout","rendered":null,"spans":[]}],"code":{"code":"clippy::print_stdout","explanation":null},"level":"warning","message":"use of `print!`","spans":[{"byte_end":188,"byte_start":173,"column_end":20,"column_start":5,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":8,"line_start":8,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":20,"highlight_start":5,"text":"    print!(\"{}\", x);"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: use of `println!`\n  --> src\\main.rs:11:5\n   |\n11 |     println!(\"{:?}\", y);\n   |     ^^^^^^^^^^^^^^^^^^^\n   |\n   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout\n\n","children":[{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_stdout","rendered":null,"spans":[]}],"code":{"code":"clippy::print_stdout","explanation":null},"level":"warning","message":"use of `println!`","spans":[{"byte_end":273,"byte_start":254,"column_end":24,"column_start":5,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":11,"line_start":11,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":24,"highlight_start":5,"text":"    println!(\"{:?}\", y);"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: use of `Debug`-based formatting\n  --> src\\main.rs:11:15\n   |\n11 |     println!(\"{:?}\", y);\n   |               ^^^^\n   |\nnote: the lint level is defined here\n  --> src\\main.rs:1:9\n   |\n1  | #![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]\n   |         ^^^^^^^^^^^^^^^^^^^\n   = note: `#[warn(clippy::use_debug)]` implied by `#[warn(clippy::restriction)]`\n   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_debug\n\n","children":[{"children":[],"code":null,"level":"note","message":"the lint level is defined here","rendered":null,"spans":[{"byte_end":27,"byte_start":8,"column_end":28,"column_start":9,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":28,"highlight_start":9,"text":"#![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]"}]}]},{"children":[],"code":null,"level":"note","message":"`#[warn(clippy::use_debug)]` implied by `#[warn(clippy::restriction)]`","rendered":null,"spans":[]},{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_debug","rendered":null,"spans":[]}],"code":{"code":"clippy::use_debug","explanation":null},"level":"warning","message":"use of `Debug`-based formatting","spans":[{"byte_end":268,"byte_start":264,"column_end":19,"column_start":15,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":11,"line_start":11,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":19,"highlight_start":15,"text":"    println!(\"{:?}\", y);"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: digit groups should be smaller\n --> src\\main.rs:7:18\n  |\n7 |     let x: u64 = 6186491_8973511;\n  |                  ^^^^^^^^^^^^^^^ help: consider: `61_864_918_973_511`\n  |\nnote: the lint level is defined here\n --> src\\main.rs:1:30\n  |\n1 | #![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]\n  |                              ^^^^^^^^^^^^^^^^\n  = note: `#[warn(clippy::large_digit_groups)]` implied by `#[warn(clippy::pedantic)]`\n  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_digit_groups\n\n","children":[{"children":[],"code":null,"level":"note","message":"the lint level is defined here","rendered":null,"spans":[{"byte_end":45,"byte_start":29,"column_end":46,"column_start":30,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":46,"highlight_start":30,"text":"#![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]"}]}]},{"children":[],"code":null,"level":"note","message":"`#[warn(clippy::large_digit_groups)]` implied by `#[warn(clippy::pedantic)]`","rendered":null,"spans":[]},{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_digit_groups","rendered":null,"spans":[]},{"children":[],"code":null,"level":"help","message":"consider","rendered":null,"spans":[{"byte_end":167,"byte_start":152,"column_end":33,"column_start":18,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":7,"line_start":7,"suggested_replacement":"61_864_918_973_511","suggestion_applicability":"MachineApplicable","text":[{"highlight_end":33,"highlight_start":18,"text":"    let x: u64 = 6186491_8973511;"}]}]}],"code":{"code":"clippy::large_digit_groups","explanation":null},"level":"warning","message":"digit groups should be smaller","spans":[{"byte_end":167,"byte_start":152,"column_end":33,"column_start":18,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":7,"line_start":7,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":33,"highlight_start":18,"text":"    let x: u64 = 6186491_8973511;"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: unused variable: `z`\n  --> src\\main.rs:12:9\n   |\n12 |     let z = \"this is a relatively long string, to see the diff between strings and code.\";\n   |         ^ help: if this is intentional, prefix it with an underscore: `_z`\n   |\n   = note: `#[warn(unused_variables)]` on by default\n\n","children":[{"children":[],"code":null,"level":"note","message":"`#[warn(unused_variables)]` on by default","rendered":null,"spans":[]},{"children":[],"code":null,"level":"help","message":"if this is intentional, prefix it with an underscore","rendered":null,"spans":[{"byte_end":284,"byte_start":283,"column_end":10,"column_start":9,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":12,"line_start":12,"suggested_replacement":"_z","suggestion_applicability":"MachineApplicable","text":[{"highlight_end":10,"highlight_start":9,"text":"    let z = \"this is a relatively long string, to see the diff between strings and code.\";"}]}]}],"code":{"code":"unused_variables","explanation":null},"level":"warning","message":"unused variable: `z`","spans":[{"byte_end":284,"byte_start":283,"column_end":10,"column_start":9,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":12,"line_start":12,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":10,"highlight_start":9,"text":"    let z = \"this is a relatively long string, to see the diff between strings and code.\";"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: unused variable: `a`\n  --> src\\main.rs:13:9\n   |\n13 |     let a = \"test\";\n   |         ^ help: if this is intentional, prefix it with an underscore: `_a`\n\n","children":[{"children":[],"code":null,"level":"help","message":"if this is intentional, prefix it with an underscore","rendered":null,"spans":[{"byte_end":375,"byte_start":374,"column_end":10,"column_start":9,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":13,"line_start":13,"suggested_replacement":"_a","suggestion_applicability":"MachineApplicable","text":[{"highlight_end":10,"highlight_start":9,"text":"    let a = \"test\";"}]}]}],"code":{"code":"unused_variables","explanation":null},"level":"warning","message":"unused variable: `a`","spans":[{"byte_end":375,"byte_start":374,"column_end":10,"column_start":9,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":13,"line_start":13,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":10,"highlight_start":9,"text":"    let a = \"test\";"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: missing documentation for the crate\n  --> src\\main.rs:1:1\n   |\n1  | / #![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]\n2  | |\n3  | | mod test;\n4  | |\n...  |\n14 | |     test::tree::printlol();\n15 | | }\n   | |_^\n   |\nnote: the lint level is defined here\n  --> src\\main.rs:1:9\n   |\n1  | #![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]\n   |         ^^^^^^^^^^^^^^^^^^^\n   = note: `#[warn(clippy::missing_docs_in_private_items)]` implied by `#[warn(clippy::restriction)]`\n   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items\n\n","children":[{"children":[],"code":null,"level":"note","message":"the lint level is defined here","rendered":null,"spans":[{"byte_end":27,"byte_start":8,"column_end":28,"column_start":9,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":28,"highlight_start":9,"text":"#![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]"}]}]},{"children":[],"code":null,"level":"note","message":"`#[warn(clippy::missing_docs_in_private_items)]` implied by `#[warn(clippy::restriction)]`","rendered":null,"spans":[]},{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items","rendered":null,"spans":[]}],"code":{"code":"clippy::missing_docs_in_private_items","explanation":null},"level":"warning","message":"missing documentation for the crate","spans":[{"byte_end":415,"byte_start":0,"column_end":2,"column_start":1,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":15,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":80,"highlight_start":1,"text":"#![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]"},{"highlight_end":1,"highlight_start":1,"text":""},{"highlight_end":10,"highlight_start":1,"text":"mod test;"},{"highlight_end":1,"highlight_start":1,"text":""},{"highlight_end":12,"highlight_start":1,"text":"fn main() {"},{"highlight_end":31,"highlight_start":1,"text":"    println!(\"Hello, world!\");"},{"highlight_end":34,"highlight_start":1,"text":"    let x: u64 = 6186491_8973511;"},{"highlight_end":21,"highlight_start":1,"text":"    print!(\"{}\", x);"},{"highlight_end":23,"highlight_start":1,"text":"    let x = [3, 4, 5];"},{"highlight_end":37,"highlight_start":1,"text":"    let y: [u8; 3] = x.map(|x| x*3);"},{"highlight_end":25,"highlight_start":1,"text":"    println!(\"{:?}\", y);"},{"highlight_end":91,"highlight_start":1,"text":"    let z = \"this is a relatively long string, to see the diff between strings and code.\";"},{"highlight_end":20,"highlight_start":1,"text":"    let a = \"test\";"},{"highlight_end":28,"highlight_start":1,"text":"    test::tree::printlol();"},{"highlight_end":2,"highlight_start":1,"text":"}"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: package `testbed` is missing `package.description` metadata\n  |\nnote: the lint level is defined here\n --> src\\main.rs:1:48\n  |\n1 | #![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]\n  |
                          ^^^^^^^^^^^^^\n  = note: `#[warn(clippy::cargo_common_metadata)]` implied by `#[warn(clippy::cargo)]`\n  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata\n\n","children":[{"children":[],"code":null,"level":"note","message":"the lint level is defined here","rendered":null,"spans":[{"byte_end":60,"byte_start":47,"column_end":61,"column_start":48,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":61,"highlight_start":48,"text":"#![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]"}]}]},{"children":[],"code":null,"level":"note","message":"`#[warn(clippy::cargo_common_metadata)]` implied by `#[warn(clippy::cargo)]`","rendered":null,"spans":[]},{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata","rendered":null,"spans":[]}],"code":{"code":"clippy::cargo_common_metadata","explanation":null},"level":"warning","message":"package `testbed` is missing `package.description` metadata","spans":[{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: package `testbed` is missing `either package.license or package.license_file` metadata\n  |\n  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata\n\n","children":[{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata","rendered":null,"spans":[]}],"code":{"code":"clippy::cargo_common_metadata","explanation":null},"level":"warning","message":"package `testbed` is missing `either package.license or package.license_file` metadata","spans":[{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: package `testbed` is missing `package.repository` metadata\n  |\n  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata\n\n","children":[{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata","rendered":null,"spans":[]}],"code":{"code":"clippy::cargo_common_metadata","explanation":null},"level":"warning","message":"package `testbed` is missing `package.repository` metadata","spans":[{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: package `testbed` is missing `package.readme` metadata\n  |\n  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata\n\n","children":[{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata","rendered":null,"spans":[]}],"code":{"code":"clippy::cargo_common_metadata","explanation":null},"level":"warning","message":"package `testbed` is missing `package.readme` metadata","spans":[{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: package `testbed` is missing `package.keywords` metadata\n  |\n  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata\n\n","children":[{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata","rendered":null,"spans":[]}],"code":{"code":"clippy::cargo_common_metadata","explanation":null},"level":"warning","message":"package `testbed` is missing `package.keywords` metadata","spans":[{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: package `testbed` is missing `package.categories` metadata\n  |\n  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata\n\n","children":[{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata","rendered":null,"spans":[]}],"code":{"code":"clippy::cargo_common_metadata","explanation":null},"level":"warning","message":"package `testbed` is missing `package.categories` metadata","spans":[{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: missing documentation for a module\n --> src\\main.rs:3:1\n  |\n3 | mod test;\n  | ^^^^^^^^^\n  |\n  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items\n\n","children":[{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items","rendered":null,"spans":[]}],"code":{"code":"clippy::missing_docs_in_private_items","explanation":null},"level":"warning","message":"missing documentation for a module","spans":[{"byte_end":90,"byte_start":81,"column_end":10,"column_start":1,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":3,"line_start":3,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":10,"highlight_start":1,"text":"mod test;"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: missing documentation for a module\n --> src\\test\\mod.rs:1:1\n  |\n1 | pub mod tree;\n  | ^^^^^^^^^^^^^\n  |\n  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items\n\n","children":[{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items","rendered":null,"spans":[]}],"code":{"code":"clippy::missing_docs_in_private_items","explanation":null},"level":"warning","message":"missing documentation for a module","spans":[{"byte_end":13,"byte_start":0,"column_end":14,"column_start":1,"expansion":null,"file_name":"src\\test\\mod.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":14,"highlight_start":1,"text":"pub mod tree;"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: missing documentation for a function\n --> src\\test\\tree\\mod.rs:1:1\n  |\n1 | / pub fn printlol() {\n2 | |     print!(\"it worked!\");\n3 | | }\n  | |_^\n  |\n  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items\n\n","children":[{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items","rendered":null,"spans":[]}],"code":{"code":"clippy::missing_docs_in_private_items","explanation":null},"level":"warning","message":"missing documentation for a function","spans":[{"byte_end":49,"byte_start":0,"column_end":2,"column_start":1,"expansion":null,"file_name":"src\\test\\tree\\mod.rs","is_primary":true,"label":null,"line_end":3,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":20,"highlight_start":1,"text":"pub fn printlol() {"},{"highlight_end":26,"highlight_start":1,"text":"    print!(\"it worked!\");"},{"highlight_end":2,"highlight_start":1,"text":"}"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: `x` shadows a previous, unrelated binding\n --> src\\main.rs:9:9\n  |\n9 |     let x = [3, 4, 5];\n  |         ^\n  |\nnote: the lint level is defined here\n --> src\\main.rs:1:9\n  |\n1 | #![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]\n  |         ^^^^^^^^^^^^^^^^^^^\n  = note: `#[warn(clippy::shadow_unrelated)]` implied by `#[warn(clippy::restriction)]`\nnote: previous binding is here\n --> src\\main.rs:7:9\n  |\n7 |     let x: u64 = 6186491_8973511;\n  |         ^\n  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated\n\n","children":[{"children":[],"code":null,"level":"note","message":"the lint level is defined here","rendered":null,"spans":[{"byte_end":27,"byte_start":8,"column_end":28,"column_start":9,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":28,"highlight_start":9,"text":"#![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]"}]}]},{"children":[],"code":null,"level":"note","message":"`#[warn(clippy::shadow_unrelated)]` implied by `#[warn(clippy::restriction)]`","rendered":null,"spans":[]},{"children":[],"code":null,"level":"note","message":"previous binding is here","rendered":null,"spans":[{"byte_end":144,"byte_start":143,"column_end":10,"column_start":9,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":7,"line_start":7,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":10,"highlight_start":9,"text":"    let x: u64 = 6186491_8973511;"}]}]},{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated","rendered":null,"spans":[]}],"code":{"code":"clippy::shadow_unrelated","explanation":null},"level":"warning","message":"`x` shadows a previous, unrelated binding","spans":[{"byte_end":199,"byte_start":198,"column_end":10,"column_start":9,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":9,"line_start":9,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":10,"highlight_start":9,"text":"    let x = [3, 4, 5];"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: missing `return` statement\n  --> src\\main.rs:10:32\n   |\n10 |     let y: [u8; 3] = x.map(|x| x*3);\n   |                                ^^^ help: add `return` as shown: `return x*3`\n   |\nnote: the lint level is defined here\n  --> src\\main.rs:1:9\n   |\n1  | #![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]\n   |         ^^^^^^^^^^^^^^^^^^^\n   = note: `#[warn(clippy::implicit_return)]` implied by `#[warn(clippy::restriction)]`\n   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return\n\n","children":[{"children":[],"code":null,"level":"note","message":"the lint level is defined here","rendered":null,"spans":[{"byte_end":27,"byte_start":8,"column_end":28,"column_start":9,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":28,"highlight_start":9,"text":"#![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]"}]}]},{"children":[],"code":null,"level":"note","message":"`#[warn(clippy::implicit_return)]` implied by `#[warn(clippy::restriction)]`","rendered":null,"spans":[]},{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return","rendered":null,"spans":[]},{"children":[],"code":null,"level":"help","message":"add `return` as shown","rendered":null,"spans":[{"byte_end":247,"byte_start":244,"column_end":35,"column_start":32,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":10,"line_start":10,"suggested_replacement":"return x*3","suggestion_applicability":"MachineApplicable","text":[{"highlight_end":35,"highlight_start":32,"text":"    let y: [u8; 3] = x.map(|x| x*3);"}]}]}],"code":{"code":"clippy::implicit_return","explanation":null},"level":"warning","message":"missing `return` statement","spans":[{"byte_end":247,"byte_start":244,"column_end":35,"column_start":32,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":10,"line_start":10,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":35,"highlight_start":32,"text":"    let y: [u8; 3] = x.map(|x| x*3);"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: `x` shadows a previous, unrelated binding\n  --> src\\main.rs:10:29\n   |\n10 |     let y: [u8; 3] = x.map(|x| x*3);\n   |                             ^\n   |\nnote: previous binding is here\n  --> src\\main.rs:9:9\n   |\n9  |     let x = [3, 4, 5];\n   |         ^\n   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated\n\n","children":[{"children":[],"code":null,"level":"note","message":"previous binding is here","rendered":null,"spans":[{"byte_end":199,"byte_start":198,"column_end":10,"column_start":9,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":9,"line_start":9,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":10,"highlight_start":9,"text":"    let x = [3, 4, 5];"}]}]},{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated","rendered":null,"spans":[]}],"code":{"code":"clippy::shadow_unrelated","explanation":null},"level":"warning","message":"`x` shadows a previous, unrelated binding","spans":[{"byte_end":242,"byte_start":241,"column_end":30,"column_start":29,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":10,"line_start":10,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":30,"highlight_start":29,"text":"    let y: [u8; 3] = x.map(|x| x*3);"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: integer arithmetic detected\n  --> src\\main.rs:10:32\n   |\n10 |     let y: [u8; 3] = x.map(|x| x*3);\n   |                                ^^^\n   |\nnote: the lint level is defined here\n  --> src\\main.rs:1:9\n   |\n1  | #![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]\n   |         ^^^^^^^^^^^^^^^^^^^\n   = note: `#[warn(clippy::integer_arithmetic)]` implied by `#[warn(clippy::restriction)]`\n   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic\n\n","children":[{"children":[],"code":null,"level":"note","message":"the lint level is defined here","rendered":null,"spans":[{"byte_end":27,"byte_start":8,"column_end":28,"column_start":9,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":28,"highlight_start":9,"text":"#![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]"}]}]},{"children":[],"code":null,"level":"note","message":"`#[warn(clippy::integer_arithmetic)]` implied by `#[warn(clippy::restriction)]`","rendered":null,"spans":[]},{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic","rendered":null,"spans":[]}],"code":{"code":"clippy::integer_arithmetic","explanation":null},"level":"warning","message":"integer arithmetic detected","spans":[{"byte_end":247,"byte_start":244,"column_end":35,"column_start":32,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":10,"line_start":10,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":35,"highlight_start":32,"text":"    let y: [u8; 3] = x.map(|x| x*3);"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: restriction lints are not meant to be all enabled\n --> src\\main.rs:1:9\n  |\n1 | #![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]\n  |         ^^^^^^^^^^^^^^^^^^^\n  |\n  = note: `#[warn(clippy::blanket_clippy_restriction_lints)]` on by default\n  = help: try enabling only the lints you really need\n  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blanket_clippy_restriction_lints\n\n","children":[{"children":[],"code":null,"level":"note","message":"`#[warn(clippy::blanket_clippy_restriction_lints)]` on by default","rendered":null,"spans":[]},{"children":[],"code":null,"level":"help","message":"try enabling only the lints you really need","rendered":null,"spans":[]},{"children":[],"code":null,"level":"help","message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blanket_clippy_restriction_lints","rendered":null,"spans":[]}],"code":{"code":"clippy::blanket_clippy_restriction_lints","explanation":null},"level":"warning","message":"restriction lints are not meant to be all enabled","spans":[{"byte_end":27,"byte_start":8,"column_end":28,"column_start":9,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":28,"highlight_start":9,"text":"#![warn(clippy::restriction, clippy::pedantic, clippy::cargo, clippy::nursery)]"}]}]}}
{"reason":"compiler-message","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"message":{"rendered":"warning: 22 warnings emitted\n\n","children":[],"code":null,"level":"warning","message":"22 warnings emitted","spans":[]}}
{"reason":"compiler-artifact","package_id":"testbed 0.1.0 (path+file:///C:/Users/lollipopft/testbed/rust)","manifest_path":"C:\\Users\\lollipopft\\testbed\\rust\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testbed","src_path":"C:\\Users\\lollipopft\\testbed\\rust\\src\\main.rs","edition":"2018","doc":true,"doctest":false,"test":true},"profile":{"opt_level":"0","debuginfo":2,"debug_assertions":true,"overflow_checks":true,"test":false},"features":[],"filenames":["C:\\Users\\lollipopft\\testbed\\rust\\target\\debug\\deps\\libtestbed-1c5b6f5b4f1126a5.rmeta"],"executable":null,"fresh":true}
{"reason":"build-finished","success":true}

Support for multi-line errors

Nim sometimes outputs errors that span multiple lines, eg. type mismatches. Example:

/home/daknus/Coding/Nim/tsuki/src/tsuki/vm.nim(271, 4) Error: type mismatch: got <State>
but expected one of:
proc interpret(s: State; chunk: Chunk; procName = "<main chunk>";
               initialStack: seq[Value] = @[])
  first type mismatch at position: 2
  missing parameter: chunk

expression: interpret(s)

The default interpreter shouldn't have to support this

This could be implemented as maybe a keyboard shortcut to show the whole error in an autocomplete-like popup, appearing below the error message.

Support for "gutter rails"

This is a thing that can be seen in Rust error messages:

error[E0382]: use of moved value: `a`
 --> src/main.rs:5:5
  |
2 |     let a = String::from("aa");
  |         - move occurs because `a` has type `String`, which does not implement the `Copy` trait
3 |     let b = a;
  |             - value moved here
4 |     println!("{}", b);
5 |     a
  |     ^ value used here after move

I think it would be fun (and quite useful) to create a visual representation of these errors in the editor.

Basically, a "gutter rail" is a "rail" on the gutter, which is simply a vertical line spanning from the first line where the error occurs, to the last line where the error's children messages end.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.