Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Atom Editor 1.15.0 with Go-Plus has red background in function source code

Tags:

go

atom-editor

I have updated Atom to latest (1.15.0) and updated all plugin. I have go-plus and go-debug plugins.

I get randomly red background for large number of methods in Go files. If I save file it disappears for few seconds.

enter image description here

I thought it is some warning but I do not see warning in go-plus.

Any ideas.. What does red bg means and how to disable it?

like image 934
Artem Avatar asked Apr 05 '17 08:04

Artem


People also ask

Why is my code in Atom not colored?

If your file has extension HTML or ejs (. html, . ejs) language-ejs package can 't recognize those file.In the bottom right corner of the screen, change the HTML to ejs or javascript, then the atom can recognize that the code your write is parts of ejs. NOte, you need to install language -ejs package first.

How do I change the color code in an Atom?

Open a file written in the language that you want to specify the colors for in Atom. Put the cursor at the characters in an element that you want to change the color, pressing Ctrl + Alt + Shift + P (Windows …

How do I install go Plus in Atom?

From the main menu, Go to File → Preferences → Settings. In the Search packages search box, enter the following: go-plus. You should see one result come up as shown below. Click on Install and let it complete.

What happened to Atom editor?

We are archiving Atom and all projects under the Atom organization for an official sunset on December 15, 2022. When we formally introduced Atom in 2014, we set out to give developers a text editor that was deeply customizable but also easy to use—one that made it possible for more people to build software.


1 Answers

If a package has no test files, Atom will show the default background for all source code lines.

If a package has at least 1 test file, by default tests are run on every save. While the tests are run, the lines are displayed with default background, and when tests complete, code lines that can be tested but were not covered by tests will appear with red background.

You can change this in settings:

View -> Preferences -> Packages -> go-plus settings -> Test section
  • Run Tests On Save: with this you can disable running tests on save
  • Run Tests With Coverage: disabling this will still run your tests, but will not run them with coverage mode, and thus will not highlight untested lines
  • Coverage Highlight Mode: with this setting you can choose what to highlight, by default untested code is highlighted in red background, you can opt to highlight tested lines with green background, or highhlight both, or none of them (disabled)
  • Coverage Display Mode: now this comes handy; default option is highlight, which shows the whole lines using different background. Change it to gutter, and now only the line numbers will have different background, but not the code itself, this is much less disturbing

This was introduced in go-plus v5.0. Here's an animated gif to highlight the differences:

enter image description here

like image 50
icza Avatar answered Oct 27 '22 14:10

icza