C-IDE with Sublime Text? - ide

Is there a good possibility to convert Sublime into a simple IDE that allows to edit, compile, link and run C prgograms. Without SublimeClang please, since this is not maintained anymore.

Read up on Sublime's build systems and make. Both are very powerful tools, and allow for a lot of customization. You might need to do a bit of shell scripting to tie everything together into one command, but it's definitely possible, and not that hard, especially if you make good use of the built-in variables. The existing C++ system (available in Packages/C++/C++.sublime-build) should give you something to start with:
{
"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"cmd": ["bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"]
}
]
}

Please look for bendras.co.uk blog post about Sublime Text 3 as C++ IDE by Paulius Zaliaduonis. You will find more details how to do it.
Here is what you'll need:
ctags
gdb
Sublime Text 3
Sublime Text Package Control
Sublime package CTags
Sublime package SublimeGDB
Your build system
All packages should work on most platforms: Windows, Linux, iOS?

Related

How to see react scripts ESLint errors with TSLint

The react-script uses typescript-eslint internally which trows warnings/error and you see it in the terminal where the app is running.
I did create react app with create-react-app --typescript and did set up a tslint.json as follow:
{
"defaultSeverity": "error",
"extends": [
"tslint:recommended",
"tslint-react",
"tslint-eslint-rules",
"tslint-plugin-prettier",
"tslint-config-prettier"
],
"jsRules": {},
"linterOptions": {
"exclude": ["node_modules", "dist", "build", "src/serviceWorker.ts"]
},
"rules": {
"prettier": [true, "./.prettierrc"]
},
"rulesDirectory": []
}
and a lint check script like "lint": "tslint -p tsconfig.json -c tslint.json 'src/**/*.{ts,tsx}'" in package.json.
But not all typescript-eslint from react-script is covered by tslint and the lint script passes while there exists some warning.
Should I completely dump the usage of tslint and go for eslint? If so can someone provide a snippet for the settings?
Or if Tslint has any plan to be update and cover all those warnings from typescript-eslint
Perhaps you could adjust your tslint configuration to get those warning it missed, but I don't think it is worth it.
For starters, as you note CRA has switched to eslint-typescript, and I think it is easier to just use the one officially supported linter rather then using both the old and the new.
Also, tslint is formally deprecated in favour of eslint-typescript so you are swimming against the stream and I doubt there will be updates. You might be able to get tslint to work as you want now, but probably not for the lifetime of your app.
The switch to eslint-typescript was announced almost a year ago and now that the major projects like CRA have also switched I think that early issues are resolved and it is time for all new projects to use it.

Does zef recognize and handle pre-release modules?

I have a module App::Assixt, to which I've recently made a relatively large change. I've of course tested it on my local system, but would like to give it some field testing before calling it a "stable release".
Is there a way to "tag" this release as an "alpha", or "release-candidate", so this release will only be installed by people who have opted to use unstable/testing releases?
zef will treat versions the same as Perl 6:
# true because "1.0.a" < "1.0.0"
$ perl6 -e 'say Version.new("1.0.PREVIEW") < Version.new("1.0")'
True
If a Foo:ver<1.0.PREVIEW> is installed it can be used as Foo:ver<1.0.PREVIEW> or Foo:ver<1.0>. This means any systems that have Foo:ver<1.0.PREVIEW> installed would need to uninstall it to upgrade / install Foo:ver<1.0> in the future ( unless using --force-install ), but also that authors can write code for the final version without declaring the extra .PREVIEW everywhere.
This is not very useful in regards to publishing -- zef will grab the newest version by default despite the user not having opted in to whatever versioning scheme is in use. Since the user wants to opt-in for this, there are two options.
1) Create e.g. unstable, testing, stable` indexes and convince people to use them
This could be done by copying the zef config to %*ENV<XDG_CONFIG_HOME>/zef/config.json and incorporate the following:
"Repository" : [
{
"short-name" : "unstable",
"enabled" : 0,
"module" : "Zef::Repository::Ecosystems",
"options" : {
"name" : "unstable",
"mirrors" : [ "/path/or/url/to/package/list.json" ]
}
}
]
Which allows:
zef install Foo::Bar --unstable
2) Give out a link to the resource without publishing it
zef install https://github.com/ugexe/Perl6-Text--Table--Simple.git#v0.0.4
zef install https://github.com/ugexe/Perl6-Text--Table--Simple/archive/v0.0.3.zip

Elm "cannot find module"

I'm fairly new in Elm. It's interesting to see a functional language which allows you to develop front-end stuff. Now even if I am following the steps described here nicely, I still have problems with modules.
The code is
module Main where
import Html exposing ( Html )
import Signal
main : Signal Html.Html
main = Html.text "This should work."
|> Signal.constant
I have used elm-reactor -a='localhost' to be able to view my output. But I am getting an error, that module 'HTML' cannot be found:
I cannot find find module 'Html'.
Module 'Main' is trying to import it.
Potential problems could be:
* Misspelled the module name
* Need to add a source directory or new dependency to elm-package.json
(note the double "find" hehe)
The fix suggestion didn't help me. Or it could be that I'm not understanding the use of the .json file correctly.
elm-package.json:
{
"version": "1.0.0",
"summary": "testing elm",
"license": "BSD3",
"source-directories": [
".",
"./bin/"
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "3.0.0 <= v < 4.0.0"
},
"elm-version": "0.16.0 <= v < 0.17.0"
}
Here is a screenshot of my file tree.
Maybe it behaves differently than how Haskell is threatening the modules.
How can I solve this - eh simple? - problem.
Or is my elm-package.json just configured incorrectly?
Update for Elm 0.17
In 0.17, the Html package has been moved to elm-lang/html. Run the following command from the terminal to install it:
elm package install elm-lang/html
You should also remove the evancz/elm-html package from elm-package.json because it no longer exists as of 0.17.
For more information about the upgrading from 0.16 to 0.17, please see the 0.17 announcement.
Original Answer for Elm 0.16
Your elm-package.json configuration is missing the evancz/elm-html package, which exposes Html. You can use elm's package manager to install dependencies rather than editing elm-package.json directly.
From the terminal, type the following:
elm package install evancz/elm-html
You will also be prompted to install a few other missing dependencies required by evancz/elm-html. Running this command will update your elm-package.json file as well as pull down the missing packages from the internet and install them in the standard elm-stuff/packages directory.
More info on the elm-package tool can be found here.
You can browse elm packages online at package.elm-lang.org. The sidebar has a Popular Packages section which contains the evancz/elm-html package mentioned here.

Can't get Atom Linter to work

I'm new to Atom, the text edit, and I installed many packages, including Linter
https://github.com/AtomLinter/Linter
But it's not showing errors or highlighting code, it's just getting ignored.
Do any of you know what I should do to get this to work?
You have to additionally install a linter package for your desired language.
Here is a list: https://atomlinter.github.io/
I needed to remove atom config and start from scratch to make linter working
mv ~/.atom ~/.atom.bak
Instead of opening atom from the terminal like I normally do, I opened it from the application icon. Then atom asks if it was ok to install linter dependencies and presto it was working.
Hope this helps.
My problem with linter-eslint was because I accidentally installed eslint 8 which is not yet supported by atom linter or linter-eslint. After I installed eslint ^7.32.0 and typed npm i, restarted Atom and changed ecmaversion from 13 to 12 everything started working fine!
When I start Atom up, the small UI panel in bottom left is present, but shows zero values for the 3 severities.
If I then do a CTRL-s/save (even with no changes), it starts working..
In my package settings, I have "Lint on Open" (which doesn't seem to work at all) and "Lint on Change" (which is "only for supported providers" so could be that) ticked.
Here is my .eslintrc. Hope it helps.
module.exports = {
root: true,
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
}
},
"extends" : "rallycoding",
"rules": {
"react/require-extension": "off"
}
};
I had to add the path of my project's node_modules dir to the Atom's eslint package settings, as well as create an .eslinterc.json file in my project. After doing both those, I had to restart Atom (I started it from the command line $ atom .) and it started working.

Sublime Text 2 and ZF2 ... auto complete not works

I installed sublime text 2 with all php dependencies.
And also a package for code complete called sublimecodeintel.
There is not zf2 supported auto code complete.
For example, when I start writing
\Zend\Form\...
at each steps CTRL+Space does not give any subclasses of Form
or for example after this:
$testimonial = new \Application\Entity\Testimonial();
when I write this:
$testimonial->
CTRL+Space shows a list but there is no methods listed from Testimonial php class.
Please help.
You might need to add the path to the ZF2 folder if they aren't in one of the project folders, or you could add a .codeintel/config file to your project root and add:
{
"PHP": {
"php": '/usr/bin/php',
"phpExtraPaths": ['path/to/ZF2'],
"phpConfigFile": 'php.ini'
}
}
So make sure you have the paths set up correctly, and it should work.
Also SublimeCodeIntels default mappings for autocomple is:
Linux: shift+ctrl+space
Mac: shift+super+space
Windows: shift+ctrl+space
Sublime Text 2 is not an IDE and so does not have autocomplete. You could try installing the SublimeCodeIntel package and see if that works for you.
Alternatively, consider NetBeans, PHPStorm, Zend Studio or Eclipse/PDT which are all IDEs that understand how to do auto complete with PHP.