Replies: 8 comments 17 replies
-
Searching higher-level directories like git seems like a good way to go as also discussed in this issue: #172 |
Beta Was this translation helpful? Give feedback.
-
This is a great idea. I would also like to see extensions for Atom and Visual Studio Code, perhaps integrated with fpm GUI (https://fortran-lang.discourse.group/t/experimenting-with-a-gui-for-fpm/1186). |
Beta Was this translation helpful? Give feedback.
-
Last year, there was a presentation on the integration of Visual Studio
Code for Fortran during the conference. I would have dig a bit in the
archives who did the presentation, but the idea of further integration with
such tools is definitely worthwhile.
Op wo 26 mei 2021 om 14:16 schreef Carlos Une ***@***.***>:
… This is a great idea. I would also like to see extensions for Atom and
Visual Studio Code, perhaps integrated with fpm GUI (
https://fortran-lang.discourse.group/t/experimenting-with-a-gui-for-fpm/1186
).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#479 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN6YR4PS35BTBII64RRR23TPTRBRANCNFSM45R4ACLQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Oh, then I misremembered it - but now you mention it, it was indeed
Code::Blocks. (Visual Studio Code has been gaining interest in my
company/institute).
Op wo 26 mei 2021 om 15:56 schreef Ivan Pribec ***@***.***>:
… In the FortranCon 2020 archive I was only able to find the Code::Blocks
<https://tcevents.chem.uzh.ch/event/12/contributions/41/attachments/41/114/CodeBlocks_DariusMarkauskas.pdf>
presentation (the Code::Blocks Fortran plugin page is located here
<https://cbfortran.sourceforge.io/>).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#479 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN6YR3CJTG3UAWR5TDIHWLTPT4ZFANCNFSM45R4ACLQ>
.
|
Beta Was this translation helpful? Give feedback.
-
Adding this to {
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build with FPM",
"command": "fpm",
"args": [
"build"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Run Tests",
"command": "fpm",
"args": [
"test"
],
"group": {
"kind": "test",
"isDefault": true
}
}
]
} The commands "Tasks: Run Build Task" and "Tasks: Run Test Task" from the ctrl+shift+P command palette can then be used to invoke fpm. The default command can be set using "Tasks: Configure Default Build/Test Task". |
Beta Was this translation helpful? Give feedback.
-
@everythingfunctional just released a plugin for the Atom Editor. More information can be found at Discourse: https://fortran-lang.discourse.group/t/fpm-plugin-for-atom-editor/1747 The sources for the plugin are available on GitHub: https://github.com/everythingfunctional/atom-build-fpm An earlier thread also contains a plugin for Visual Studio: https://fortran-lang.discourse.group/t/fortran-package-manager-fpm-for-visual-studio/1346 Thanks Brad for doing the work! I believe Atom and VS Code share some similarities, maybe you could join forces with @plevold? |
Beta Was this translation helpful? Give feedback.
-
So it turns out the Build Systems API in Sublime made it pretty easy to map the basic fpm commands. Essentially, Sublime will search for the keyfile
{
"keyfiles": ["fpm.toml"],
"working_dir": "$project_path",
"variants":
[
{
"name": "Build (debug)",
"cmd": ["fpm", "build", "--profile", "debug"]
},
{
"name": "Build (release)",
"cmd": ["fpm", "build", "--profile", "release"]
},
{
"name": "Test (debug)",
"cmd": ["fpm", "test", "--profile", "debug"]
},
{
"name": "Test (release)",
"cmd": ["fpm", "test", "--profile", "release"]
},
{
"name": "Help",
"shell_cmd": "fpm help"
}
]
} I'm still figuring out what is the best way to map the In it's basic version, the Sublime Build Systems API only performs expansion of the following variables: Variables (click to expand)
Their is an advanced API which allows much more complex commands: accepting user input (e.g. for options), suggesting completions, etc. - but it requires writing a Python plugin. Presumably one would first write a Python class shadowing all the fpm commands. (Caveat: the built-in terminal where Sublime runs your build system command does not accept any user input. The only way you can communicate with your app is through an external file. For interactive input it's necessary to launch an independent Terminal instance, using a package like Terminus. Furthermore if your program uses write or print statements, depending on how your compiler/platform implement buffering, you might not see any output until the program finishes.) |
Beta Was this translation helpful? Give feedback.
-
Something that I can't still figure out how to do is to automate the debugging process inside VSCode (with fpm). Right now I build the executable into a specific folder and have set up the {
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Fortran",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/bin/debuggable",
"args": [], // Possible input args for the exectuable
"stopAtEntry": true,
"cwd": "${workspaceFolder}/bin",
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "make debug"
}
]
} |
Beta Was this translation helpful? Give feedback.
-
Many modern text editors have shortcuts for building or running a program. For example in my favorite editor - Sublime, one can use the following build system scripts:
Build
Build and run
The default build option is accessed using Ctrl + B, while more control over the build system script option can be selected using Ctrl + Shift + B.
The scripts above only work for a single main program. I imagine with
fpm
it should be possible to build a program at any location in the source tree with the right commands.One problem I see is how does
fpm
figure which is the top level directory, where thefpm.toml
is located. One option could be to prepend each source file with some identifier, or recursively search the higher level directories until one of them contains thefpm.toml
file.Ideally, we could try to offer packages for the editors, that users can easily install and gain access to.
What are your thoughts on this?
Beta Was this translation helpful? Give feedback.
All reactions