Recent

Author Topic: Freepascal support for Visual Studio Code  (Read 5204 times)

helio

  • New Member
  • *
  • Posts: 29
Freepascal support for Visual Studio Code
« on: September 29, 2021, 08:24:52 pm »
Freepascal and Pas2Js support for Visual Studio Code.

 - Project manager
 - Project building
 - Project settings
 - Code Completation
 - Code Definition
 - Code Indentation
 - Code Jump
 - Code Suggestion
 - Code Refactory
 - Code Snippets
 - Syntax Coloring

 https://github.com/heliosroots/fp-vscode
« Last Edit: October 05, 2021, 12:33:25 pm by helio »

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: Freepascal support for Visual Studio Code
« Reply #1 on: September 29, 2021, 09:05:40 pm »
Will test. Note ther are a few others, so curious.. :)
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

helio

  • New Member
  • *
  • Posts: 29
Re: Freepascal support for Visual Studio Code
« Reply #2 on: October 05, 2021, 12:35:20 pm »
Create, edit, compile and manage your freepascal and pas2js font codes with VSCode... an alternative to lazarus ide

PascalDragon

  • Hero Member
  • *****
  • Posts: 5481
  • Compiler Developer
Re: Freepascal support for Visual Studio Code
« Reply #3 on: October 05, 2021, 01:25:39 pm »
Regarding code completion and such there is also a Pascal Language Server that makes use of Lazarus' CodeTools package to provide everything. To avoid the hassle to implement support for every language construct yourself. ;)

helio

  • New Member
  • *
  • Posts: 29
Re: Freepascal support for Visual Studio Code
« Reply #4 on: October 05, 2021, 01:31:36 pm »
internally I use codetools, so it works as in the lazarus ide... 8-)

PascalDragon

  • Hero Member
  • *****
  • Posts: 5481
  • Compiler Developer
Re: Freepascal support for Visual Studio Code
« Reply #5 on: October 05, 2021, 01:33:26 pm »
Ah, hadn't drilled that far down into your code yet. :-[

PierceNg

  • Sr. Member
  • ****
  • Posts: 374
    • SamadhiWeb
Re: Freepascal support for Visual Studio Code
« Reply #6 on: October 06, 2021, 05:39:14 am »
Freepascal and Pas2Js support for Visual Studio Code.

Hi. Other than configuring in settings, what else need to do? I have set up the paths to the fpc and pas2js compilers and their source locations.

When I open a .lpr file (for pas2js) and right click 'go to definition' or 'peek definition', it says not found.

(In the same instance of VS Code, Omni Pascal extension finds the definitions.)

helio

  • New Member
  • *
  • Posts: 29
Re: Freepascal support for Visual Studio Code
« Reply #7 on: October 06, 2021, 11:22:38 am »
- You should always load the configuration file project.lpr.json => F10
- If the code is legacy you must create the file project.lpr.json => CTRL+ALT+N => template settings
- It is important not to use other extensions there may be a conflict between them, if you can disable them

PierceNg

  • Sr. Member
  • ****
  • Posts: 374
    • SamadhiWeb
Re: Freepascal support for Visual Studio Code
« Reply #8 on: October 06, 2021, 03:12:47 pm »
- You should always load the configuration file project.lpr.json => F10
- If the code is legacy you must create the file project.lpr.json => CTRL+ALT+N => template settings

I was opening an existing project which has an .lpi file from Lazarus. I created a new project that generated project1.lpr.json, then copied it to myproject.lpr.json. Then reopened VS Code and use F10 to load myproject.lpr.json. Then code browsing works.

So using F10 to load the project JSON file is the key step?

- It is important not to use other extensions there may be a conflict between them, if you can disable them

Yes I was testing them one at a time.

helio

  • New Member
  • *
  • Posts: 29
Re: Freepascal support for Visual Studio Code
« Reply #9 on: October 06, 2021, 03:53:22 pm »
- The lazarus Ide, uses the associated ".lpi" file, to maintain the project configuration
- Fp-Vscode, uses the ".lpr.json" files, to keep the project configuration

- Then you should always load the ".lpr.json" file
- It must be manual because you can have multiple ".lpr.json" files
- Upload only once, and use it in all your work

helio

  • New Member
  • *
  • Posts: 29
Re: Freepascal support for Visual Studio Code
« Reply #10 on: October 06, 2021, 04:11:59 pm »
- If you already have a ready-made project generated in the lazarus ide, you can use ctrl+alt+n and choose the "settings" template so it will create a configuration file
- Then it's just up to you to adjust these settings and set the dependencies
« Last Edit: October 06, 2021, 05:18:44 pm by helio »

 

TinyPortal © 2005-2018