Software Using VS Code ... not an Orbiter thread ...

llarian

Well-known member
Joined
Apr 1, 2009
Messages
575
Reaction score
159
Points
58
Location
Ottawa
Hi guys. I recently installed Anaconda3 for a bit of Python work and to familiarize myself with it. After the usual installation headaches, it also loaded in Visual Studio Code.

I know VS Code is primarily an editor and similar functions often take similar forms. My question is, do any of you use VS Code and what are your opinions of it and what advises might you give?

Thanks in advance

Editted: Any suggestions for adding Lua to VS Code?
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,588
Reaction score
2,312
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
I used it at work for a quick C# project and really liked it. Especially the pretty UNIX like dev process.
 

dbeachy1

O-F Administrator
Administrator
Orbiter Contributor
Addon Developer
Donator
Beta Tester
Joined
Jan 14, 2008
Messages
9,214
Reaction score
1,560
Points
203
Location
VA
Website
alteaaerospace.com
Preferred Pronouns
he/him
I use VS Code at work for both Angular and Ruby on Rails (and did some Ember in it for a few months), and I quite like it: it's fast, lightweight, and has IntelliSense for a number of languages (check plugins for it).
 

n122vu

Addon Developer
Addon Developer
Donator
Joined
Nov 1, 2007
Messages
3,196
Reaction score
51
Points
73
Location
KDCY
I use it at work as well for just editing single code or config files, when I don't need full-blown Visual Studio features. My go-to editor most of the time.
 

llarian

Well-known member
Joined
Apr 1, 2009
Messages
575
Reaction score
159
Points
58
Location
Ottawa
Thanks. You guys are great! Well, no fears then, just the usual jitters. Best to delve right in.

And I did find and install the Lua extension. Time to learn.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,842
Reaction score
2,105
Points
203
Location
between the planets
My question is, do any of you use VS Code and what are your opinions of it and what advises might you give?

Using it at work for pretty much all jobs that involve simple scripting where an IDE only gets in the way. There was a time I also did angular with it, and it works well enough, but then we got a license for the complete jetbrains product package, so WebStorm has taken over for that. I still prefer it to RubyMine for managing our puppet repository, though that's probably just because I never get the time to give RubyMine a real chance. I also used to do PhP with it, for the rare times I had to bother with that horrible misconception of a language... :lol:

That's really the greates strength of VS Code, I think. At the core, it really is just an editor, and there's basically no time investment needed to get going, but it also provides a lot of conveniences like folder view, source managment and integrated console that make life a lot easier when compared to other editors.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,588
Reaction score
2,312
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Using it at work for pretty much all jobs that involve simple scripting where an IDE only gets in the way.

Or in my case: Needed to replace a small command line tool at the customer with a version that works. No sources available, but after a bit of reverse engineering, the function was clear. And why it did not work.

A full Visual Studio installation would cost a bit of money, too much for a task that only needs to be done once per year, if at all. Also too powerful for something that only consists of two source files and a few test suites.

Visual Studio Code was absolutely well suited for the task, once you mastered the dotnet command.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,842
Reaction score
2,105
Points
203
Location
between the planets
A full Visual Studio installation would cost a bit of money

Well, there's always the express edition, but yes, the thing is really too large and unwieldy for simple stuff.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,588
Reaction score
2,312
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Well, there's always the express edition, but yes, the thing is really too large and unwieldy for simple stuff.

It would also cause some licensing issues for a top two car manufacturer. :lol:
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,842
Reaction score
2,105
Points
203
Location
between the planets
It would also cause some licensing issues for a top two car manufacturer.

If it's only being used for maintaining internal software? Shouldn't that be covered by the express license?
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,588
Reaction score
2,312
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
If it's only being used for maintaining internal software? Shouldn't that be covered by the express license?

Not sure there - that is what you should ask a lawyer there. I remember how terrible I had to explain why I am including Guice in a Java project and if that is legal.
 

Blake

Addon Developer
Addon Developer
Joined
Mar 9, 2009
Messages
225
Reaction score
104
Points
58
Location
Lehi, Utah
My understanding:
'Express' is now 'Community' and it is free unless you are an enterprise (there are other exceptions):


If you are an enterprise, your employees and contractors may not use the software to develop or test your applications, except for: (i) open source; (ii) Visual Studio extensions; (iii) device drivers for the Windows operating system; and, (iv) education purposes as permitted above.


An “enterprise” is any organization and its affiliates who collectively have either (a) more than 250 PCs or users or (b) one million U.S. dollars (or the equivalent in other currencies) in annual revenues, and “affiliates” means those entities that control (via majority ownership), are controlled by, or are under common control with an organization.



https://visualstudio.microsoft.com/license-terms/mlt553321/


I use the free 'Community' edition for personal work, and a paid subscription for professional work, which like Urwumpe is for one of the most well-known enterprises in the world and can afford a license or two.



For me, Code is slowly replacing Notepad++...slowly.
 

n122vu

Addon Developer
Addon Developer
Donator
Joined
Nov 1, 2007
Messages
3,196
Reaction score
51
Points
73
Location
KDCY
Same here. We fall under the Enterprise definition of the license, and each dev has an MSDN subscription provided by the company.

Blake said:
For me, Code is slowly replacing Notepad++...slowly.

Same here. In fact I recently got a new laptop at work, about 2 months ago. I installed Notepad++ after migrating all my work, but I honestly don't think I've launched it yet. Everything I do these days is in VS Code or Visual Studio Pro.
 

Majid

Active member
Joined
Oct 31, 2014
Messages
156
Reaction score
27
Points
43
Don't want to necro, but as there haven't been any other posts in this forum lately I thought I'd share my vim setup:

I use Vundle for plugin management.

P6IMhuD.jpg

okCoCfs.jpg

My .vimrc

Code:
set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'Townk/vim-autoclose'
Plugin 'scrooloose/nerdtree'
Plugin 'flazz/vim-colorschemes'
Plugin 'pangloss/vim-javascript'
Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'Shougo/unite.vim'
Plugin 'Shougo/vimproc.vim'
Bundle 'L9'
Bundle 'FuzzyFinder'
Plugin 'maksimr/vim-jsbeautify'
Plugin 'tpope/vim-fugitive'
Plugin 'OmniSharp/omnisharp-vim'
" Track the engine.
Plugin 'SirVer/ultisnips'
Plugin 'vim-syntastic/syntastic'
" Snippets are separated from the engine. Add this if you want them:
Plugin 'honza/vim-snippets'
Plugin 'fatih/vim-go'
Plugin 'python-mode/python-mode'
Plugin 'kien/ctrlp.vim'
Plugin 'zcodes/vim-colors-basic'
Plugin 'dikiaap/minimalist'
Plugin 'othree/xml.vim'
Plugin 'millermedeiros/vim-esformatter'
Plugin 'ruanyl/vim-fixmyjs'
Plugin 'mxw/vim-jsx'
Plugin 'airblade/vim-gitgutter' 
" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required

" activates syntax highlighting among other things
syntax on
syntax enable

" allows you to deal with multiple unsaved
" buffers simultaneously without resorting
" to misusing tabs

" just hit backspace without this one and
" see for yourself
set backspace=indent,eol,start

set expandtab
set shiftwidth=2
set softtabstop=2
set laststatus=2
nmap ,b :FufBuffer<CR>
"nmap ,f :FufFile<CR>
nmap ,f :FufFileWithFullCwd **/<CR>
nmap ,w :bd<CR>
set guifont=Fira\ Mono\ For\ Powerline:h14
set shortmess+=A
set ic
map <c-f> :call JsBeautify()<cr>
let g:fuf_help_cache_dir = ''
let g:fuf_tag_cache_dir = ''
let g:fuf_taggedfile_cache_dir = ''
nmap <leader>ne :NERDTree<cr>
map <F11> <Esc>:call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)<CR> 
let g:Omnisharp_start_server = 0
" OmniSharp won't work without this setting
filetype plugin on

"This is the default value, setting it isn't actually necessary
let g:OmniSharp_host = "http://localhost:2000"

"Set the type lookup function to use the preview window instead of the status line
"let g:OmniSharp_typeLookupInPreview = 1

"Timeout in seconds to wait for a response from the server
let g:OmniSharp_timeout = 1

"Showmatch significantly slows down omnicomplete
"when the first match contains parentheses.
set noshowmatch

"Super tab settings - uncomment the next 4 lines
let g:SuperTabDefaultCompletionType = 'context'
let g:SuperTabContextDefaultCompletionType = "<c-x><c-o>"
let g:SuperTabDefaultCompletionTypeDiscovery = ["&omnifunc:<c-x><c-o>","&completefunc:<c-x><c-n>"]
let g:SuperTabClosePreviewOnPopupClose = 1

"don't autoselect first item in omnicomplete, show if only one item (for preview)
"remove preview if you don't want to see any documentation whatsoever.
set completeopt=longest,menuone,preview
" Fetch full documentation during omnicomplete requests.
" There is a performance penalty with this (especially on Mono)
" By default, only Type/Method signatures are fetched. Full documentation can still be fetched when
" you need it with the :OmniSharpDocumentation command.
let g:omnicomplete_fetch_documentation=1

"Move the preview window (code documentation) to the bottom of the screen, so it doesn't move the code!
"You might also want to look at the echodoc plugin
set splitbelow

" Get Code Issues and syntax errors
let g:syntastic_cs_checkers = ['syntax', 'semantic', 'issues']
" If you are using the omnisharp-roslyn backend, use the following
" let g:syntastic_cs_checkers = ['code_checker']
augroup omnisharp_commands
    autocmd!

    "Set autocomplete function to OmniSharp (if not using YouCompleteMe completion plugin)
    autocmd FileType cs setlocal omnifunc=OmniSharp#Complete

    nnoremap <Leader>dnb :!dotnet build<CR>
    nnoremap <Leader>dnr :!dotnet run<CR>
    " Synchronous build (blocks Vim)
    "autocmd FileType cs nnoremap <F5> :wa!<cr>:OmniSharpBuild<cr>
    " Builds can also run asynchronously with vim-dispatch installed
    "autocmd FileType cs nnoremap <leader>b :wa!<cr>:OmniSharpBuildAsync<cr>
    " automatic syntax check on events (TextChanged requires Vim 7.4)
    autocmd BufEnter,TextChanged,InsertLeave *.cs SyntasticCheck

    " Automatically add new cs files to the nearest project on save
    "autocmd BufWritePost *.cs call OmniSharp#AddToProject()

    "show type information automatically when the cursor stops moving
    autocmd CursorHold *.cs call OmniSharp#TypeLookupWithoutDocumentation()

    "The following commands are contextual, based on the current cursor position.

    autocmd FileType cs nnoremap gd :OmniSharpGotoDefinition<cr>
    autocmd FileType cs nnoremap <leader>fi :OmniSharpFindImplementations<cr>
    autocmd FileType cs nnoremap <leader>ft :OmniSharpFindType<cr>
    autocmd FileType cs nnoremap <leader>fs :OmniSharpFindSymbol<cr>
    autocmd FileType cs nnoremap <leader>fu :OmniSharpFindUsages<cr>
    "finds members in the current buffer
    autocmd FileType cs nnoremap <leader>fm :OmniSharpFindMembers<cr>
    " cursor can be anywhere on the line containing an issue
    autocmd FileType cs nnoremap <leader>x  :OmniSharpFixIssue<cr>
    autocmd FileType cs nnoremap <leader>fx :OmniSharpFixUsings<cr>
    autocmd FileType cs nnoremap <leader>tt :OmniSharpTypeLookup<cr>
    autocmd FileType cs nnoremap <leader>dc :OmniSharpDocumentation<cr>
    "navigate up by method/property/field
    "autocmd FileType cs nnoremap <C-K> :OmniSharpNavigateUp<cr>
    "navigate down by method/property/field
    "autocmd FileType cs nnoremap <C-J> :OmniSharpNavigateDown<cr>

augroup END


" this setting controls how long to wait (in ms) before fetching type / symbol information.
set updatetime=500
" Remove 'Press Enter to continue' message when type information is longer than one line.
set cmdheight=2

" Contextual code actions (requires CtrlP or unite.vim)
nnoremap <leader><space> :OmniSharpGetCodeActions<cr>
" Run code actions with text selected in visual mode to extract method
vnoremap <leader><space> :call OmniSharp#GetCodeActions('visual')<cr>

" rename with dialog
nnoremap <leader>nm :OmniSharpRename<cr>
nnoremap <F2> :OmniSharpRename<cr>
" rename without dialog - with cursor on the symbol to rename... ':Rename newname'
command! -nargs=1 Rename :call OmniSharp#RenameTo("<args>")

" Force OmniSharp to reload the solution. Useful when switching branches etc.
nnoremap <leader>rl :OmniSharpReloadSolution<cr>
nnoremap <leader>cf :OmniSharpCodeFormat<cr>
" Load the current .cs file to the nearest project
nnoremap <leader>tp :OmniSharpAddToProject<cr>

" Add syntax highlighting for types and interfaces
nnoremap <leader>th :OmniSharpHighlightTypes<cr>
"Don't ask to save when changing buffers (i.e. when jumping to a type definition)
set hidden

" Enable snippet completion, requires completeopt-=preview
let g:OmniSharp_want_snippet=0
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
"let g:UltiSnipsExpandTrigger="<tab>"
"let g:UltiSnipsJumpForwardTrigger="<c-b>"
"let g:UltiSnipsJumpBackwardTrigger="<c-z>"

" If you want :UltiSnipsEdit to split your window.
" let g:UltiSnipsEditSplit="vertical"
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_nr_show = 0 


augroup reload_vimrc " {
    autocmd!
    autocmd BufWritePost $MYVIMRC source $MYVIMRC
augroup END " }

set number


" snippets
nnoremap <leader>meanstart :-1read ~/snippets/express.js<cr>
nnoremap <leader>meanmod :-1read ~/snippets/mongomod.js<cr>
nnoremap <leader>html :-1read ~/snippets/html.html<cr>
nnoremap <leader>meanroute :-1read ~/snippets/meanroute.js<cr>
nnoremap <leader>meanspec :-1read ~/snippets/meanspec.js<cr>
nnoremap <leader>meanvalid :-1read ~/snippets/meanvalid.js<cr>
nnoremap <leader>chaimocha :-1read ~/snippets/chaimocha.html<cr>
nnoremap <leader>mochaspec :-1read ~/snippets/mochaspec.js<cr>
nnoremap <leader>dirspec :-1read ~/snippets/tangdir.js<cr>
nnoremap <leader>conspec :-1read ~/snippets/tancon.js<cr>
nnoremap <leader>jspm :-1read ~/snippets/jspm.html<cr>
nnoremap <leader>eslintrc :-1read ~/snippets/eslintrc.js<cr>
nnoremap <leader>reactcomp :-1read ~/snippets/reactcomp.js<cr>
nnoremap <leader>imprr :-1read ~/snippets/imprr.js<cr>
nnoremap <leader>reactapp :-1read ~/snippets/reactapp.js<cr>
nnoremap <leader>andir :-1read ~/snippets/andir.js<cr>

nnoremap <leader>b :CtrlPBuffer<cr>
nnoremap <leader>setjs :set filetype=javascript<cr>
nnoremap <leader>setft :set filetype=
nnoremap <leader>qa :bufdo bd<cr>

set t_Co=256
syntax on
syntax enable
set background=dark
colorscheme monokai
"autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
"set omnifunc=syntaxcomplete#Complete
let g:tern#is_show_argument_hints_enabled = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_fields = 1
let g:go_highlight_types = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_fmt_command = "goimports"
au FileType go nmap <leader>r <Plug>(go-run)
au FileType go nmap <leader>build <Plug>(go-build)
au FileType go nmap <leader>test <Plug>(go-test)
au FileType go nmap <leader>c <Plug>(go-coverage)
au FileType go nmap <leader>td <Plug>(go-def-tab)
au FileType go nmap <leader>gd <Plug>(go-doc)
au FileType go nmap <leader>s <Plug>(go-implements)

let g:syntastic_javascript_checkers = ['eslint']
au BufNewFile,BufRead *.xaml setf xml
au BufNewFile,BufRead *.cs setf cs 

nnoremap <silent> <leader>es :Esformatter<CR>
vnoremap <silent> <leader>es :EsformatterVisual<CR>
nnoremap <Leader>fix :Fixmyjs<cr>
nnoremap <F5> :silent! bufdo e<cr>
set confirm

let g:fixmyjs_rc_path = 'C:\Users\mali\.eslintrc'
let g:jsx_ext_required = 0
set hlsearch
set incsearch
nnoremap <silent> <Leader>= :exe "resize " . (winheight(0) * 3/2)<CR>
nnoremap <silent> <Leader>- :exe "resize " . (winheight(0) * 2/3)<CR>
nnoremap <silent> <Leader>0 :exe "vertical resize " . (winwidth(0) * 3/2)<CR>
nnoremap <silent> <Leader>9 :exe "vertical resize " . (winwidth(0) * 2/3)<CR>
function! NumberToggle()
  if(&relativenumber == 1)
    set nornu
  else
    set rnu
  endif
endfunc

nnoremap <silent> <Leader>num :call NumberToggle()<cr>

nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
nnoremap <C-Q> <C-W><C-Q>
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe,*\\dist\\*,*\\node_modules\\*

let g:ctrlp_custom_ignore = '\v[\/](node_modules|target|dist)|(\.(swp|ico|git|svn|dll))$'

let g:ctrlp_max_files=0
let g:ctrlp_max_depth=40
:set guioptions-=T  "remove toolbar
:set guioptions-=r  "remove right-hand scroll bar
:set guioptions-=L  "remove left-hand scroll bar
:set guioptions-=m  "remove left-hand scroll bar

nnoremap <leader>sp :setlocal spell spelllang=en_us <cr>
map <F4> :execute "vimgrep /" . expand("<cword>") . "/j **" <Bar> cw<CR>

au FileType markdown nnoremap <leader>figure :-1read ~/snippets/figure.txt<cr>
au FileType markdown nnoremap <leader>newpost :-1read ~/snippets/newpost.txt<cr>


nmap <F2> i<C-R>=strftime("%FT%T%z")<CR><Esc>
imap <F2> <C-R>=strftime("%FT%T%z")<CR>

augroup myvimrc
    autocmd!
    autocmd QuickFixCmdPost [^l]* cwindow
    autocmd QuickFixCmdPost l*    lwindow
augroup END

VS Code is pretty nice as well, and it has a decent vim emulation mode.
 
Last edited:

ADSWNJ

Scientist
Addon Developer
Joined
Aug 5, 2011
Messages
1,667
Reaction score
3
Points
38
My son is at university, learning to code C, C++, Python, Java, on Linux using vim, gcc makefiles, and gdb from the command line. It's brutal compared to what we do as devs do in Windows in a nice graphical Visual Studio Express or full verison. Is there a better way, using just a text interface, not an X Window?
 

Majid

Active member
Joined
Oct 31, 2014
Messages
156
Reaction score
27
Points
43
My son is at university, learning to code C, C++, Python, Java, on Linux using vim, gcc makefiles, and gdb from the command line. It's brutal compared to what we do as devs do in Windows in a nice graphical Visual Studio Express or full verison. Is there a better way, using just a text interface, not an X Window?

Doesn't sound brutal to me! MSbuild is brutal imho. :rofl: In all seriousness though, imo cmd line based tooling is awesome because it allows you to chain commands to automate stuff and build your own tooling. Like for instance, it's really easy to build a go program through vim, and I can even build Orbiter C++ plugins in Vim via MSBuild. Vim can do pretty much anything.

Here's a screenie of me doing a fuzzy file search, and showing git integration where the green + indicates a new line has been added, and much much more. Even has very good IntelliSense for Python/Golang/C# (via omnisharp). I think my next editor is going to be Neovim.

GQ3kV66.jpg
 
Last edited:

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,842
Reaction score
2,105
Points
203
Location
between the planets
It's brutal compared to what we do as devs do in Windows in a nice graphical Visual Studio Express or full verison.

It's got nothing to do with Windows. It's mostly got to do with university teachers being fond of archaic tools...

I'm not saying those tools are bad, but they have a somewhat steep learning curve, which imho is not ideal to throw at novice coders.
There's perfectly good editors available in Linux, VS code being only one of them. So script languages are mostly no problem. For anything building for a JVM, Jetbrains IntelliJ IDE beats everything and everyone without even trying, and there's a very capable free edition of it.

You won't get around command-line compilation, though. Not in the long run anyways. As a matter of fact, practically all build processes are ultimately command-line based, IDEs merely provide an interface for it (and, in case of Visual Studio, it's not really the best...). Whatever build system is running under the hood, it's ultimately command line based, and it's very healthy to do the footwork by yourself for a bit. Helps a lot when you'll be setting up Jenkins pipelines or similar later on, and ultimately an automated build and deployment pipeline is what you need in a production environment, not an IDE that spits out an executable on a mouse click...
 

avasthisamar

New member
Joined
Mar 12, 2019
Messages
2
Reaction score
0
Points
0
Software Using VS Code not an Orbiter thread ...

1.Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter:
2.ext install vscode-lua.
 
Top