Git Product home page Git Product logo

Comments (2)

bostick avatar bostick commented on May 24, 2024 2

Probably the best place is opening an issue for the CodeFormatter repo:
https://github.com/WolframResearch/codeformatter

There are various options for the formatter that are exposed as options for the functions in the CodeFormatter` context.

I talk about the CodeFormatter` package in this talk from WTC2020:
Formatting the Wolfram Language (youtube)

There is not yet a convenient way of modifying settings through VSCode, but you can modify settings for the formatter by changing the command for the LSP server and settings various variables.

Here is an example command with line width of Infinity and using the experimental line-breaking method "LineBreakerV2":

"wolfram.command": [
    "`kernel`",
    "-noinit",
    "-noprompt",
    "-nopaclet",
    "-nostartuppaclets",
    "-noicon",
    "-run",
    "Needs[\"LSPServer`\"];CodeFormatter`$DefaultLineWidth=Infinity;CodeFormatter`$DefaultBreakLinesMethod=\"LineBreakerV2\";LSPServer`StartServer[]"
]

LineBreakerV2 tries to do a better job of understanding and using the tree-structure of the code. But there are still issues and it is not yet turned on by default.

Formatter-specific issues can be opened here:
https://github.com/WolframResearch/codeformatter

from vscode-wolfram.

hifismith avatar hifismith commented on May 24, 2024

This is really great information, thank you!

The IntelliJ plugin is quadrupling in price, so I thought I'd check in on the VS Code plugin. Formatting is probably my biggest hurdle in switching, so I'll definitely review the links you sent. Btw, thanks for adding the section folding. It's working

from vscode-wolfram.

Related Issues (20)

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.