Code Monkey home page Code Monkey logo

vscode-lingua-franca's Introduction

Lingua Franca support for Visual Studio Code

CI

This extension adds language support for Lingua Franca (LF). It is based on the LF Language and Diagram Server and provides:

  • find references
  • folding ranges
  • get workspace symbols
  • hover
  • KlighD-based interactive diagrams (click on diagrams icon: image)
  • syntax highlighting
  • target syntax highlighting
  • code validation upon edit
  • target code validation upon build or file save
  • user-triggered build (Ctrl + Shift + P, then Lingua Franca: Build)
  • user-triggered build and run (Ctrl + Shift + P, then Lingua Franca: Build and Run)

Quick Start

  1. Install this plugin from the VSCode Marketplace/Open VSX Registry (in the command palette Ctrl + P, enter ext install lf-lang.vscode-lingua-franca)
  2. (Skip this step if you already have Lingua Franca projects that you'd like to work on.) Create a new Lingua Franca project by creating a <My Project Name>/src folder and putting a file in it that has the .lf extension.
  3. Open a Lingua Franca project (File > Add Folder to Workspace...). The Explorer (upper left in sidebar) should now show your project files. Open the .lf file you created.
  4. (Optional) Show the diagram for this file by clicking on the diagrams icon at the upper right: image)
  5. Compile the .lf file and run it using (Ctrl + Shift + P, then Lingua Franca: Build and Run).

Requirements

This extension requires Java 17 or up in order to run its embedded Lingua Franca language server. You might need to install additional software to be able to build or execute target code produced by the Lingua Franca compiler. The extension reports missing dependencies upon attempting to build or run.

Settings

Automatic code generation is enabled by default to allow target code to be validated on save. To disable automatic code generation, add the following to .vscode/settings.json:

{
    "linguafranca.generateCodeOnSave": false
}

Contributing

We very much appreciate contributions in the form of code, tests, documentation, bug reports, and feature requests. For more details, see CONTRIBUTING.md.

Join us!

Configuration

Diagrams

To enable diagram-based code navigation, go to Settings > Extensions > KLighD Diagram and deactivate Initial Should Select Diagram and activate Initial Should Select Text instead.

vscode-lingua-franca's People

Contributors

a-sr avatar cmnrd avatar edwardalee avatar francabot avatar jesslin02 avatar lhstrh avatar petervdonovan avatar soerendomroes avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vscode-lingua-franca's Issues

GSON Parse error when opening diagram

I did not observe any effects from the GUI, but this error message appeared in the output (View -> Output -> LF Language Server):

May 18, 2022 1:52:26 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint logIssues
WARNING: Issue found in NotificationMessage: Message could not be parsed.
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_ARRAY at line 1 column 56 path $.params
	at com.google.gson.Gson.fromJson(Gson.java:975)
	at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.fromJson(MessageTypeAdapter.java:329)
	at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.parseParams(MessageTypeAdapter.java:249)
	at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.read(MessageTypeAdapter.java:119)
	at org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapter.read(MessageTypeAdapter.java:55)
	at com.google.gson.Gson.fromJson(Gson.java:963)
	at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.parseMessage(MessageJsonHandler.java:119)
	at org.eclipse.lsp4j.jsonrpc.json.MessageJsonHandler.parseMessage(MessageJsonHandler.java:114)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:193)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.IllegalStateException: Expected a string but was BEGIN_ARRAY at line 1 column 56 path $.params
	at com.google.gson.stream.JsonReader.nextString(JsonReader.java:824)
	at com.google.gson.internal.bind.TypeAdapters$15.read(TypeAdapters.java:380)
	at com.google.gson.internal.bind.TypeAdapters$15.read(TypeAdapters.java:368)
	at com.google.gson.Gson.fromJson(Gson.java:963)
	... 15 more

This error can be reproduced by opening lingua-franca/test/C/src/ArrayFree.lf and opening the corresponding diagram.

Remove use of `Buffer()`

(node:9936) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

VS code Plugin error report when there is a cyclic dependency.

I'm Byeonggil Jun, an undergraduate student who is working on LF, especially the ts target advised by professor Hokeun Kim.

I'd like to report an error in VS Code plugin that I'm experiencing.

I'm currently using VS Code's LF plugin for development.
When my code has a cyclic dependency error, half of the diagram is painted red in the VS Code plugin's diagram.
On the other hand, in the epoch, the diagram is displayed perfectly.
image

This is my code. The purpose of this code is to take a user input on one federate and print it on another federate, iteratively.

target TypeScript;
reactor Input_iterator {
    input imes:string;
    input init:string;
    output message:string;
    physical action b;

    preamble {=
        import * as readline from "readline";
    =}

    reaction(startup, init) -> b {=
        const rl = readline.createInterface({
         input: process.stdin,
         output: process.stdout
         });

        rl.question("type any words ", (answer) => {
        console.log(`Word: ${answer}`);
        actions.b.schedule(new TimeValue(t, TimeUnit.msec),answer as string);
        rl.close();
        });
    =}
    reaction(b) -> message {=
        message = b as string;
    =}
 }

 reactor printer {
    input imes:string;
    output done:string;
    physical action a;
    reaction(imes) -> a{=
        console.log(imes);
        actions.a.schedule(new TimeValue(5, TimeUnit.msec)), null)
    =}
    reaction(a) -> done {=
      done = "done";
=}
}
federated reactor mes_iterator {
    a = new Input_iterator();
    b = new printer();
    a.message -> b.imes;
    b.done -> a.init;
}

One possible reason is that VS Code plugin may be out of sync with the lingua-franca code base. My VS Code shows error messages below although the code is compiled successfully.
image

I experienced that error message before when I ran ./gradlew runLfc on the command line with the lingua-franca code base that was out of sync.

My development environment is as follows:
OS: Ubuntu 20.04

Please let me know if you need more information necessary for debugging.

Thanks,
Byeonggil

"New File" feature

In Code, the File->New File... dialog gives you options for file types, but LF is not included. It would be useful to have this.

Suggest `.lf` extension when saving new file

When you paste a bunch of LF code into a new file and attempt to save if, some file extension gets suggested, apparently based on some target code that VS Code recognizes in the file. Instead, it should suggest an .lf extension.

Target language semantic highlighting

Currently, we have syntax highlighting for target languages (implemented declaratively), but not semantic highlighting (implemented programmatically). The result is that although types and keywords seem to be highlighted correctly in {= =} blocks, variable names and other user-defined tokens often are not.

I am not sure yet how to fill these gaps. Not all tools that provide highlighting seem to expose an API that we can use. It is possible that we could patch up the most serious deficiencies on our own, but it would be difficult to maintain flawless highlighting for all target languages.

"Diagram Selects Text" does not work for imported reactors

This was fixed in #1055 for Epoch, but I have not figured out how to get it working in VS Code.

Klighd-vscode offers a way to handle diagram actions, including the elementSelected action, but in order to find the correct text to highlight, it would be necessary to query the language server. I'm not sure what is the best way for the language server to get that data.

`FileAlreadyExistsException` prints stack trace but VS Code does not flag compilation as failed

The following was printed:

SEVERE: Internal error: java.nio.file.FileAlreadyExistsException: /home/marten/furuta-pendulum/src-gen/FurutaPendulum/FurutaPendulum
java.util.concurrent.CompletionException: java.nio.file.FileAlreadyExistsException: /home/marten/furuta-pendulum/src-gen/FurutaPendulum/FurutaPendulum
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.nio.file.FileAlreadyExistsException: /home/marten/furuta-pendulum/src-gen/FurutaPendulum/FurutaPendulum
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:94)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:397)
	at java.base/java.nio.file.Files.createDirectory(Files.java:700)
	at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:807)
	at java.base/java.nio.file.Files.createDirectories(Files.java:753)
	at org.lflang.generator.c.CGenerator.copyUserFiles(CGenerator.java:1043)
	at org.lflang.generator.GeneratorBase.doGenerate(GeneratorBase.java:346)
	at org.lflang.generator.c.CGenerator.doGenerate(CGenerator.java:506)
	at org.lflang.generator.LFGenerator.doGenerate(LFGenerator.java:164)
	at org.eclipse.xtext.generator.GeneratorDelegate.doGenerate(GeneratorDelegate.java:44)
	at org.eclipse.xtext.generator.GeneratorDelegate.generate(GeneratorDelegate.java:35)
	at org.lflang.generator.IntegratedBuilder.doGenerate(IntegratedBuilder.java:131)
	at org.lflang.generator.IntegratedBuilder.run(IntegratedBuilder.java:95)
	at org.lflang.diagram.lsp.LFLanguageServerExtension.buildWithProgress(LFLanguageServerExtension.java:120)
	at org.lflang.diagram.lsp.LFLanguageServerExtension.lambda$1(LFLanguageServerExtension.java:93)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)

Yet, VS Code reported a successful compilation.

Usability issues with VS Code extension

There are still some problems with usability here.

  1. When I build a .lf file, the stdout from the build process is nowhere to be seen. It is not obvious that anything has happened, nor do I know how to run the compiled code.
  2. The diagram view should default to below the code rather than to the right. Most diagrams are much wider than they are tall.
  3. I think the diagram view should open by default. It's pretty obscure, and hence will likely not help new users.
  4. Maybe the quick start instructions should point to some example LF projects/programs.

Generated files and directories do not appear in Windows

LFC works fine on Windows, but for some reason (likely inadequate privileges?) the compiler does not generate directories when invoked from VS Code.

This results in errors like

java.io.IOException: Cannot run program "npm" (in directory "c:\c%3A\vscode-lingua-franca\lingua-franca\test\TypeScript\src-gen\After"): CreateProcess error=2, The system cannot find the file specified

Ship `lfc` with VS Code extension?

It would be nice to give VS Code users easier access to lfc. What's the easiest way to do this? Could it be included in the extension, somehow? Or could we add a button for a one-click installation? If we do the latter, is there a way to keep lfc in sync with the extension?

Diagrams not working in VS Code

When I use File->Open in VS code to open an LF file, the diagrams sometimes remain blank, as shown in the screen dump below. There seems to be no way to get them to appear. Also, there is no "show all details" button as in Epoch, which means that when diagrams do get rendered, they are stuck at the top-level view. Clicking on the reactors in the diagram has no effect.

image

IndexOutOfBoundsException from hover request

The following error message appeared while I was testing the LF formatter in VS Code:

	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332)
	at java.base/java.util.concurrent.CompletableFuture.andTree(CompletableFuture.java:1527)
	at java.base/java.util.concurrent.CompletableFuture.andTree(CompletableFuture.java:1517)
	at java.base/java.util.concurrent.CompletableFuture.andTree(CompletableFuture.java:1517)
	at java.base/java.util.concurrent.CompletableFuture.allOf(CompletableFuture.java:2419)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.cancel(RequestManager.java:114)
	at org.eclipse.xtext.ide.server.concurrent.RequestManager.runWrite(RequestManager.java:80)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.runBuildable(LanguageServerImpl.java:457)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.didChange(LanguageServerImpl.java:397)
	at jdk.internal.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:152)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:220)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:187)
	at org.eclipse.lsp4j.jsonrpc.validation.ReflectiveMessageValidator.consume(ReflectiveMessageValidator.java:68)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.IndexOutOfBoundsException: Position [
  line = 32
  character = 43
] text was : // Test logical action with delay.
target TypeScript

reactor GeneratedDelay {
    input y_in: number
    
    output y_out: number
    
    logical action act(100 msec)
    
    state y_state: number(0)

    reaction(y_in) -> act {=
        y_state = y_in as number;
        actions.act.schedule(0, null);
    =}
    
    reaction(act) -> y_out {=
        y_out = y_state;
    =}
}

reactor Source {
    output out: number

    reaction(startup) -> out {=
        out = 1;
    =}
}

reactor Sink(a: number(0), b: number(0), c: number(0), d: number(0)) {
    input x: number

    reaction(x) {=
        const elapsed_logical = util.getElapsedLogicalTime();
        const logical = util.getCurrentLogicalTime();
        const physical = util.getCurrentPhysicalTime();
        console.log("Logical, physical, and elapsed logical: " + logical + physical + elapsed_logical);
        const oneHundredMsec = TimeValue.msec(100);
        if (!elapsed_logical.isEqualTo(oneHundredMsec)) {
            util.requestErrorStop("Expected " + oneHundredMsec + " but got " + elapsed_logical);
        } else {
            console.log("SUCCESS. Elapsed logical time is " + elapsed_logical);
        }
    =}
}

main reactor ActionDelay {
    source = new Source()
    sink = new Sink()
    g = new GeneratedDelay()
    
    source.out -> g.y_in
    g.y_out -> sink.x
}

	at org.eclipse.xtext.ide.server.Document.getOffSet(Document.java:62)
	at org.eclipse.xtext.ide.server.hover.HoverService.hover(HoverService.java:53)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$hover$32(LanguageServerImpl.java:718)
	at org.eclipse.xtext.ide.server.WorkspaceManager.doRead(WorkspaceManager.java:438)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.hover(LanguageServerImpl.java:717)
	at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$hover$31(LanguageServerImpl.java:704)
	at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66)
	... 5 more

Perhaps this happened because the content of the document changed during the request -- I'm not sure.

I wonder if this is something that we can tolerate until we decide it is time to move away from Xtext.

Improve Highlighting of Types

Types in Lingua Franca are not really the target language proper, but they are not pure Lingua Franca either. Additionally, when they are mostly target language, they are not delimited by {= =}. There are some known issues that are related to these facts:

  • Parameter types, esp. in C and C++, should be highlighted according to the target language highlighting rules in the same way as is done for state, inputs, outputs, etc.
  • Consistency with target language rules should be attempted for other target languages as well.
  • Target language highlighting rules should not shadow Lingua Franca highlighting rules. For example, the parentheses are included as part of a function call rule in C++, shadowing LF syntax inside the parentheses.

Feature wish list

The Xtext team has already implemented many useful services, including the following. (It is not yet clear if all of them work.)

  • Content assist
  • Folding ranges
  • Find references
  • Quick fixes (beta)
  • Formatting
  • Hover
  • Highlight all references to the current symbol
  • Rename symbols
  • Get workspace symbols

Here is a list of current action items.

Required before the first release of the extension:

  • Correctly resolve dependencies that can only be retrieved using Gradle
  • Build in a way that allows faster development than fully generating the LDS jar
  • Syntax highlighting
  • Semantic highlighting
  • VS Code: Perform a full build iff the user requests it
  • Address this comment
  • Provide feedback to let the user know that a build succeeded
  • Correctly locate compile errors in preambles
  • Epoch and VS Code: Report C, C++, TS, and Rust validation messages to the appropriate lines in the editor after compilation
  • Epoch and VS Code: Report C, C++, TS, and Rust validation messages to the appropriate lines in the editor after save

Desired:

  • Give the developer of the TypeScript extension a script to automatically detect updates required in the tmLanguage.json file
  • Add "Lingua Franca: Build and Run" command (in addition to just "Lingua Franca: Build")
  • Allow debugging for C, C++, and Rust
  • Support autocompletion for all targets
  • Submit quickfixes for Lingua Franca (outside of {= =} code blocks)
  • Submit quickfixes for TS
  • Support Go to Definition for TS

Unhelpful error messages for Rust

The error message "aborting due to previous error; 4 warnings emitted" is unhelpful. Maybe it should be suppressed, or shown only if there are no other error messages.

Perhaps the real problem is "use of a blacklisted/placeholder name baz [foo.rs:61:17]," but that message does not show up consistently (i.e., on the same file, whether it appears seems to be nondeterministic). The user has to go to View > Problems in order to see the other messages. This is particularly confusing because when you use the "Build and Run" command, the program compiles and runs with no issues.

This can be reproduced (unreliably) by opening lingua-franca/test/Rust/src/TimeState.lf in VS Code.

LF Graph cannot load via VS Code

I am trying to go through LF mini-examples in this repo through my local VS Code IDE. I installed the Lingua Franca for VS Code in VS Code Market space, then I try to run the .lf file following the instructions. But there is an error for Java to compile and run, here is the error message:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/lflang/diagram/lsp/LanguageDiagramServer has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0

My operating system is macOS with version 12.4 running on Apple M1 chip. My Java version is

$ java -version
java version "1.8.0_341"
Java(TM) SE Runtime Environment (build 1.8.0_341-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)

Any suggestions about how should I proceed here?

Highlight mode names

Like parameters, modes have names that can be referenced throughout a reactor. As with parameters, semantic highlighting (implemented in TypeScript, not declaratively) is required to handle this.

Target language validation: Some errors are reported multiple times

Example:
Screenshot from 2022-07-07 22-40-39

In this case, it happens because the same line appears in multiple places in multiple different generated files. The file name and line number information from each of the different diagnostic messages should be kept, but it would be nice if the information could be consolidated.

If it is too hard to combine the different messages, we could use a similarity score (or a rule that simply ignores the file and position given in [] at the end) to determine whether to show the additional messages. It should be acceptable to hide messages because all errors/warnings should be resolved eventually, and when they are resolved, any that remain should become visible.

Can't get rid of options menu for diagrams

On a Mac at least, in VS Code, when I open the Options menu for the diagrams, as shown below, there is no way to get rid of it. It just sits there obscuring the diagram.
image

Files target property does not work within VS Code extension

To replicate, open, for example, experimental-lingua-franca/Python/src/Pac-Man/PacMan.lf and invoke the compiler using Ctrl + Shift + P, then Lingua Franca:Build. You then have to hunt for the output, but I eventually found this:

image

This file compiles fine using lfc or Epoch.

Using the "Build and Run" command on a file with TypeScript target doesn't run the program

I am on Mac OS Monterey 12.4, using Bash.
When choosing the "Build and Run" command using the VS Code extension on a TypeScript target, the program doesn't run, but rather starts the node interactive environment. This is the output:

cd /Users/billybao/lf/test
bash --login -c node src-gen/HelloWorld/dist/HelloWorld.js

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
(base) BillydeMacBook-Pro:test billybao$ cd /Users/billybao/lf/test
(base) BillydeMacBook-Pro:test billybao$ bash --login -c node src-gen/HelloWorld/dist/HelloWorld.js
Welcome to Node.js v18.4.0.
Type ".help" for more information.
> 

Suggested fix:
bash --login -c node src-gen/HelloWorld/dist/HelloWorld.js ->
bash --login -c "node src-gen/HelloWorld/dist/HelloWorld.js"

Add LICENSE.md

> [email protected] deploy
> vsce package && code --install-extension lflang-extension-*.vsix

 WARNING  LICENSE.md, LICENSE.txt or LICENSE not found
Do you want to continue? [y/N] 

Issue with `fetchDeps`

The logic in fetchDeps isn't quite right. Specifically, when the directory lingua-franca is present but empty, no action is taken to do a fresh checkout.

"Webview is disposed" error

Sometimes, when opening the diagram, the following error is shown (and the diagram is not rendered):

image

The error goes away after restarting VS Code.

Update `package.json`

The contents of README.md is shown in the extension tab in VS Code, so it should have relevant information for extension users (rather than developers who want to build the extension themselves). Also:

  • Update logo
  • Update publisher

"Build and Run" should use full path

Currently, "Build and Run" uses a relative path when attempting the run the created executable, but if the user changed directory in the terminal, the path no longer works and the executable is not found.

Create a nightly release

For users who want to be on the bleeding edge, we publish a nightly built artifact, but we don't tag a particular ref corresponding to that artifact. We should fix this in the same manner this is done in epoch.

`vsce package` is inefficient

This algorithm is causing problems for us. The build has been super slow for a long time, and this slowness is totally unnecessary. Basically vsce package indexes directories that are ignored in .vscodeignore -- in particular, the lingua-franca submodule -- only to filter them out afterward. I was prompted to investigate this when I finally started getting an Allocation failed - JavaScript heap out of memory error just by running npx vsce ls.

We need to either fix things on our end by not using the submodule, or else try to fix things on vsce's end.

Any automatic builds should be configurable

VS Code users may expect VS Code to be fairly lightweight. Therefore, it should be possible to disable any linting or slow compilation processes that are not requested explicitly by the user.

More generally, users should be able to request to use a different linter, and they should be able to change any linter settings.

Diagrams not working on Apple Silicon

Hi,

just tried out the new plugin on my new Macbook with Apple silicon, it's really good how it 'just works'!

Unfortunately the diagrams seem to be broken. There is no diagram shown and the options tab writes "no options provided by the diagram server".

For context:

java --version
openjdk 17.0.2 2022-01-18
OpenJDK Runtime Environment Homebrew (build 17.0.2+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.2+0, mixed mode, sharing)

uname -a
Darwin AG-MacBook-Pro.lan 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 arm64

code --version
1.64.1
d6ee99e4c045a6716e5c653d7da8e9ae6f5a8b03
arm64

Cmake errors need to show more details

Currently, when a Cmake error occurs upon invoking "Build and Run", the exit code is reported, but no errors are shown:

image

To get to the errors, lfc must be used. It would be better if these errors would readily show up somewhere.

Windows: CMake fails when invoked via VS Code

LFC works fine on Windows. It says:

-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.30.30705/bin/Hostx64/x64/cl.exe - skipped

In contrast, when the compiler is invoked via VS Code, we get:

-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.30.30705/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.30.30705/bin/Hostx64/x64/cl.exe - broken
-- Configuring incomplete, errors occurred!
See also "C:/c%3A/vscode-lingua-franca/lingua-franca/test/C/src-gen/ActionIsPresent/build/CMakeFiles/CMakeOutput.log".
See also "C:/c%3A/vscode-lingua-franca/lingua-franca/test/C/src-gen/ActionIsPresent/build/CMakeFiles/CMakeError.log".
CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.21/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.30.30705/bin/Hostx64/x64/cl.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/c%3A/vscode-lingua-franca/lingua-franca/test/C/src-gen/ActionIsPresent/build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/amd64/MSBuild.exe cmTC_3e151.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:m && Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(322,5): error MSB4184: The expression "[System.IO.Path]::GetFullPath(C:\c:\vscode-lingua-franca\lingua-franca\test\C\src-gen\ActionIsPresent\build\CMakeFiles\CMakeTmp\Debug\)" cannot be evaluated. The given path's format is not supported. [C:\c%3A\vscode-lingua-franca\lingua-franca\test\C\src-gen\ActionIsPresent\build\CMakeFiles\CMakeTmp\cmTC_3e151.vcxproj]
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)

This is the same C compiler and the same CMake installation, but different behavior.

Like #19, it seems like it could be a privileges issue. It exists for both C and C++ targets.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.