• Stars
    star
    230
  • Rank 174,053 (Top 4 %)
  • Language
    TypeScript
  • License
    Apache License 2.0
  • Created about 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿฉ A XMake integration in Visual Studio Code

xmake-vscode

A XMake integration in Visual Studio Code

Introduction

A XMake integration in Visual Studio Code.

You need install xmake first and a project with xmake.lua.

Please see xmake-github and website if you want to known more about xmake.

Features

  • Quickstart
  • Colorization
  • Completion Lists
  • StatusBar
  • Commands
  • Configuration
  • Build
  • Run and Debug
  • Record and Playback
  • Problem

Quickstart

Colorization and Completion Lists

StatusBar

statusbar

Commands

Configuration

Build

Run and Debug

Record and Playback

Problem

IntelliSense

xmake-vscode will generate .vscode/compile_commands.json file, so you need only add it to .vscode/c_cpp_properties.json to enable IntelliSense.

for example (.vscode/c_cpp_properties.json):

  "configurations": [
    {
      "compileCommands": ".vscode/compile_commands.json",
    }
  ],
}

How can I generate c_cpp_properties.json?

These configuration settings are stored in your project's c_cpp_properties.json file. To edit this file, in VS Code, select C/C++: Edit Configurations (UI) from the Command Palette (โ‡งโŒ˜P):

Please see IntelliSense for cross-compiling

Debugging

Debug via launch configurations (launch.json) is accessible only with Run->Start Debugging (not F5 keybinding) or via Launch Debug command.

attribute type
name string Required. Launch configuration name, as you want it to appear in the Run and Debug panel.
type string Required. Set to xmake.
request string Required. Session initiation method:launch or attach.
target string Required. XMake target.
env object Additional environment variables. {"PATH" : "some/path"}
args string โ˜ [string] Command line parameters. If not defined args are taken from debuggingTargetsArguments config.
cwd string If not defined xmake will use the target directory.
stopAtEntry boolean If set to true, the debugger should stop at the entry-point of the target (ignored on attach). Default value is false.
terminal string Destination of stdio streams:
  • console for Debug Console
  • integrated (default) for VSCode integrated terminal
  • external for a new terminal window
  • newExternal for a new terminal window but only with cli application (only cpptools / with lldb it will be converted to external)

Example:

{
    "configurations": [
    {
       "name": "XMake Debug",
        "type": "xmake",
        "request": "launch",
        "target": "example",
        "stopAtEntry": true
    }
  ]
}

Configurations related to debugging

Debugger extension

You can choose the debugger extension with xmake.debugConfigType, set it to:

  • default for cpptools debugger
  • codelldb for lldb debugger

Envs behaviour

You can choose the behaviour between xmake envs and envs that are defined in launch.json For an xmake envs that are like this {"PATH: "path/from/xmake"} and in launch.json {"PATH": "path/from/config"}.

Default is merge.

  • With xmake.envBehaviour set to merge, the result is: {"PATH": "path/from/xmake;path/from/config"}.
  • With xmake.envBehaviour set to erase, the result is: {"PATH": "path/from/xmake"}
  • And with xmake.envBehaviour set to override, the result is: {"PATH": "path/from/config"}.

XMake envs will only be replaced for the same key, if another xmake env key is present, it will be present in the final result.

Global Configuration

We can configure them in settings.json

{
    "configuration": {
        "type": "object",
        "title": "XMake configuration",
        "properties": {
            "xmake.executable": {
                "type": "string",
                "default": "xmake",
                "description": "The xmake executable name / path"
            },
            "xmake.logLevel": {
                "type": "string",
                "default": "normal",
                "description": "The Log Level: normal/verbose/minimal",
                "enum": [
                    "verbose",
                    "normal",
                    "minimal"
                ]
            },
            "xmake.buildLevel": {
                "type": "string",
                "default": "normal",
                "description": "The Build Output Level: normal/verbose/warning/debug",
                "enum": [
                    "verbose",
                    "normal",
                    "warning",
                    "debug"
                ]
            },
            "xmake.buildDirectory": {
                "type": "string",
                "default": "${workspaceRoot}/build",
                "description": "The Build Output Directory"
            },
            "xmake.installDirectory": {
                "type": "string",
                "default": "",
                "description": "The Install Output Directory"
            },
            "xmake.packageDirectory": {
                "type": "string",
                "default": "",
                "description": "The Package Output Directory"
            },
            "xmake.workingDirectory": {
                "type": "string",
                "default": "${workspaceRoot}",
                "description": "The Project Working Directory with the root xmake.lua"
            },
            "xmake.androidNDKDirectory": {
                "type": "string",
                "default": "",
                "description": "The Android NDK Directory"
            }
        }
    }
}

More Repositories

1

xmake

๐Ÿ”ฅ A cross-platform build utility based on Lua
Lua
9,868
star
2

xmake-repo

๐Ÿ“ฆ An official xmake package repository
Lua
673
star
3

xrepo

๐Ÿ—‚๏ธ A cross-platform C/C++ package manager based on Xmake
Shell
354
star
4

xmake-idea

๐Ÿจ A XMake integration in IntelliJ IDEA
Kotlin
76
star
5

xmake-docs

The xmake online documentation site
HTML
49
star
6

xmake.sh

A script-only build utility like autotools
Shell
49
star
7

xmake-gradle

A gradle plugin that integrates xmake seamlessly
Groovy
48
star
8

xrepo-cmake

CMake wrapper for Xrepo C and C++ package manager
CMake
47
star
9

awesome-xmake

๐Ÿ’• A curated list of awesome XMake projects, plugins, examples and others
35
star
10

github-action-setup-xmake

Set up your GitHub Actions workflow with a specific version of xmake
TypeScript
27
star
11

luarocks-build-xmake

A luarocks build module based on xmake
Lua
19
star
12

xmake-sublime

๐Ÿ” A XMake integration in Sublime Text
Python
19
star
13

xmake-plugins

A plugins repository based on xmake
Lua
12
star
14

smart-build

Lua
10
star
15

ModernCppStarter

Kick-start your C++! A template for modern C++ projects using XMake, CI, code coverage, clang-format, reproducible dependency management and more.
C++
9
star
16

xmake-gendoc

A cross-platform document build utility based on Lua
Lua
9
star
17

xmake-package-gentoo

Gentoo package scripts of Xmake
Shell
6
star
18

xmake-stats

The xmake statistical analysis services
5
star
19

xrepo-docs

The xrepo online documentation site
HTML
5
star
20

xmake-package-debian

Debian package scripts of Xmake
Lua
3
star
21

xmake-win32env

A win32 toolchains environment of xmake
Shell
2
star
22

xmake-win64env

A win64 toolchains environment of xmake
Shell
2
star
23

pxmake

xmake implement on python focuses on reuse python's library and API compatibility
Lua
2
star
24

.github

:octocat: Community health files.
1
star
25

xmake-package-debian-sv

Debian package scripts of Xmake/libsv
C
1
star
26

xmake-package-debian-tbox

Debian package scripts of Xmake/tbox
C
1
star