Git Product home page Git Product logo

xmake-vscode's Introduction

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"
        }
    ],
    "version": 4
}

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"
            }
        }
    }
}

xmake-vscode's People

Contributors

a2va avatar chriscatcp avatar dependabot[bot] avatar eddylin83 avatar extra-creativity avatar halcyonazure avatar haroldcc avatar hyiker avatar jorgenpt avatar jprochazk avatar junknet avatar keeyuu avatar lelouchhe avatar madhurajith avatar maxwellgengyf avatar mtrimolet avatar paul-reilly avatar pbdm avatar q962 avatar sirlynix avatar songzihui-sudo avatar star-hengxing avatar v-dao avatar v1nh1shungry avatar vosaica avatar waruqi avatar wrren avatar xiaomi2077 avatar xq114 avatar zhou-pixel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xmake-vscode's Issues

vscode debug

必须先把要用的动态dll复制到工程build的相应目录下,才能调试?

能否自定义debug配置,解决macOS 15.0以上系统不能断点调试问题

macos更新后,debug小按钮失效了

点击debug按钮,虽然能运行,但是不能调试,相当于直接运行程序。不过不是插件问题,试了一下,是cppdbg这个调试类型调试不了程序了,最后换了一个类型(安装codelldb插件,也可以调试rust的玩意),就可以了。不过插件的debug小按钮固定使用一个debug配置,现在每个项目都要用vscode自带的调试了。

在树莓派4b无法切换架构,编译报错

Note: If you use the fuzzy expressions such as 'can't use/no effect/problem/error', but don't give any relevant auxiliary information according to the template below, this issue will be not replied.

Describe the bug

在树莓派4b安装vscarm-64版本,使用xmake插件,架构固定显示x86/x64

Expected behavior

点击x86/x64切换架构时,报错Running the contributed command:'xmake.setargetarch' failed

Error output

Running the contributed command:'xmake.setargetarch' failed

Related Environment

Please provide compiling and running environment information:

  • xmake version:
  • os:Linux
  • target platform:ubuntu18.04,raspberrypi4b,

image

image

选择release,结果在undefined目录

image

构建成功,就目录名不对

xmake.lua

add_rules("mode.release")

local lua_root = "lua-5.3.5/src"

local lua_lib_file_names =
{
    "lapi.c",
    "lcode.c",
    "lctype.c",
    "ldebug.c",
    "ldo.c",
    "ldump.c", 
    "lfunc.c",
    "lgc.c",
    "llex.c",
    "lmem.c",
    "lobject.c",
    "lopcodes.c",
    "lparser.c",
    "lstate.c",
    "lstring.c",
    "ltable.c",
    "ltm.c",
    "lundump.c",
    "lvm.c",
    "lzio.c",
    "lauxlib.c",
    "lbaselib.c",
    "lbitlib.c",
    "lcorolib.c",
    "ldblib.c",
    "liolib.c",
    "lmathlib.c",
    "loslib.c",
    "lstrlib.c",
    "ltablib.c",
    "lutf8lib.c",
    "loadlib.c",
    "linit.c"
}

-- lua interpreter
target("lua")
    set_kind("binary")
    add_files(lua_root.."/lua.c")
    add_deps("lua_shared_lib")
target_end()

-- lua compiler
target("luac")
    set_kind("binary")
    add_files(lua_root.."/luac.c")
    add_deps("lua_static_lib")
target_end()

-- lua shared lib
target("lua_shared_lib")
    set_kind("shared")
    set_basename("lua")
    add_defines("LUA_USE_WINDOWS")
    add_defines("LUA_BUILD_AS_DLL")
    local file_name_count = table.getn(lua_lib_file_names);
    local file_path;
    for i = 1, file_name_count do
        file_path = lua_root.."/"..lua_lib_file_names[i]
        add_files(file_path)
    end
target_end()

-- lua static lib
target("lua_static_lib")
    set_kind("static")
    set_basename("lua_static_lib")
    add_defines("LUA_USE_WINDOWS")
    local file_name_count = table.getn(lua_lib_file_names);
    local file_path;
    for i = 1, file_name_count do
        file_path = lua_root.."/"..lua_lib_file_names[i]
        add_files(file_path)
    end
target_end()

xmake plugin cannot activate in wsl

environment: vscode 1.45.1, ubuntu 20.04 in windows 10 wsl, xmake vscode extension 1.3.4

While opening a project folder from within wsl, xmake buttons does not appear on the bottom status bar. In vscode developer tools ->console, I can see an error message which says 'cannot spawn xmake, ENOENT'.

I guess this is because xmake is installed in user's home directory and vscode cannot find it. I moved xmake files from ~/.local/xmake to /usr/local and then the problem is gone.

Since xmake is recommended to be installed locally, I'd like to know whether there's another solution to this issue.

thanks

调试功能出错:Please specify the "MIDebuggerPath" option

描述问题

任意新建一个xmake c++项目,然后使用vscode打开项目,点击底部xmake-vscode插件的调试按钮后出错,编译成功,但调试无法进行

期待的结果

开始调试程序

错误信息

图片

相关环境

Manjaro Linux x86_64
Code - OSS 1.43.2
xmake v2.3.1+202003121446

其他信息

无法在vscode server中使用

你在什么场景下需要该功能?

我在服务器上部署了vscode web,并安装了xmake插件,但是该插件不能够正常使用,希望能够增加对vscode web的适应性。

  • ubuntu18.04
  • vscode server
    在ubuntu上部署vscode server可以参考该网址,直接下载对应deb包即可完成安装。可通过修改~/.config/code-server/config.yaml绑定相应的ip地址与port。

the debug button does not work as expected

After clicking the debug button (Debug the give target), the vscode debug toolbar appears but the program does not break at the entry point or any other break points.

After some investigation, I found that changing debugConfig externalConsole to false (in ...\out\src\debugger.js) makes the debugger working properly (I have microsoft cpp tools installed):

            else if (os.platform() == "linux") {
                    debugConfig = {
                       ...
                        // externalConsole: true,
                       externalConsole: false,
                       ...
                    };

Windows Debugging Doesn't Use Configured Arguments

Describe the bug

The debugger uses xmake.debuggingTargetsArguments in order to set up the arguments for a debugging session correctly on most platforms, however when debugging on Windows these settings are ignored, and an empty argument list is used instead.

Expected behavior

Debugging on Windows should use arguments from the xmake.debuggingTargetsArguments, as is expected on other platforms.

Error output

None. Arguments are simply not used during debugging.

Related Environment

  • xmake version: v2.3.6+202007281022
  • os: Windows 10 x64
  • target platform: Windows x64

关于Qt 模板

Xmake 能增加 一些Qt模板吗?
比如
xmake create add -t qt_DialogWithButtonsBottom AboutUsDialog
创建添加一个Dialog在当前项目下
模板包括
Dialog with Buttons Bottom
Dialog wiht Buttons Right
Dialog without Buttons
Main Window
Widget

模板文件可以参考 Qt Creator 默认生成的文件

关于按F5开启调试的一个提议

主要是大部分从win平台过来的都习惯了F5,个人觉得最好能够把F5自动开启xmake run -d这个效果,类似nodejs的npm start。

然后我去看了一下关于launch.json的配置以及说明,感觉应该是可以对type这个字段下手,
我是参考了这里的,他里面type就是用了node,我感觉应该跟xmake调试启动接口类似,但是我接下来不是太明白这个地方type到底能不能自定义修改,可能需要跟vscode的插件实现有关系了吧?

不知道这个思路是不是已经有考虑过?我回头也会继续看看怎么搞。

build按钮失灵

Note: If you use the fuzzy expressions such as 'can't use/no effect/problem/error', but don't give any relevant auxiliary information according to the template below, this issue will be not replied.

Describe the bug

build按钮有时可以使用,有时不可以使用。主要表现就是在我修改cpp文件之后,按build按钮没有任何反应,必须自己手动输入xmake命令进行编译。除了build按钮不可用之外,运行按钮也不可用,只有debug按钮可以使用。重启vscode之后都可以使用。原因未知。
平台如下:
ubuntu 18.04
vscode 1.38.1 x64
VMware 15pro

Set Default Target命令显示错位

注:提问题时若使用不能用/没效果/有问题/报错此类模糊表达,但又没有根据下面的模板给出任何相关辅助信息的,将绝对不会有任何反馈。

描述问题

使用xmake命令Set Default Target时Target显示有错位问题,功能可以正常使用

期待的结果

显示没有错位

错误信息

相关环境

VSCode1.39.1
Windows 10 1903
xmake v2.2.8+201908261511

其他信息

image

image

use set_rundir config when debugging

We need to set

  "xmake.customDebugConfig": {
    "cwd":  "${workspaceFolder}"
  },

if we want to change running directory when debugging

Hope to use set_rundir by default

Windows: debugger not found on MinGW

Describe the bug

When attempting to debug a program using the xmake Debug button in the VS Code extension, we get an error message popup.

Error output

Unable to start debugging. Launch options string provided by the project system is invalid. Unable to determine path to debugger. Please specify the “MIDebuggerPath” option.

Info

The line that is causing the issue is:

https://github.com/xmake-io/xmake-vscode/blob/master/src/debugger.ts#L116

Putting the full path to gdb.exe in that field, eg:

miDebuggerPath: "C:/dev/msys64/mingw64/bin/gdb.exe",

... fixes it.

I do not know at this stage how to get the MinGW root from xmake in this extension so that we can append /bin/gdb.exe to it.


  • xmake vscode version: 1.4.3
  • os: Win10
  • target platform: MinGW

Can't debug with msys2 gdb in VSCode UI

注:提问题时若使用不能用/没效果/有问题/报错此类模糊表达,但又没有根据下面的模板给出任何相关辅助信息的,将会直接标记为Invalid。

描述问题

image
如图所示,用VS Code+Msys2 gdb时点击debug按钮没有UI提示,断点也没有作用。

期待的结果

有debug UI提示

错误信息

没有错误信息

如果是xmake相关编译问题,请加上-vD参数运行,并给出详细编译输出信息。

相关环境

请提供编译和运行环境信息,下面是一些必须填写的基础信息,便于我们针对性排查问题:

  • xmake版本:2.3.8
  • xmake运行平台:Windows 10
  • xmake目标平台:mingw

其他信息

项目配置就是默认xmake create产生的,只在main.cpp中加了几行。

命令行xmake r -d没有问题,用Visual Studio调试也没有问题。

Cannot find ".vscode\compile_commands.json".

Hi again,

Windows 10
xmake v2.3.8+202011211435
llvm-mingw
vscode 1.51.1

I'm just trying out the vscode add-in. Your instructions indicate a compile_commands.json file is generated when xmake is installed but I don't have that file in my .vscode directory? I added a reference to that file in my c_cpp_properties.json file as noted in the README:

{
    "configurations": [
        {
            "name": "Win32",
            "compileCommands": ".vscode/compile_commands.json",
            "includePath": [
                "${workspaceFolder}/**",
                "C:\\Program Files (x86)\\WinLua\\Lua\\5.3\\include"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "C:\\Users\\russh\\llvm-mingw\\bin\\clang.exe",
            "cStandard": "c17",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}

Which generates the following error:

Cannot find ".vscode\compile_commands.json".

Not a big deal, I'm just trying things out. Thanks!

Russ

vscode中调试源码的问题

调试使用不了。

下面是我的操作步骤:
xmake create -l c -t console test
cd test
xmake f -p msys -a x86_64 -m debug --toolchain=clang
code .
vscode打开后,点击vscode状态栏中xmake的"Build"选项成功编译。
在源文件中下一个有效的断点。
image
点击vscode状态栏中xmake的"调试按钮
image
"来调试程序。

image

并不能像readme所展示的那样,就可以直接启用调试。我之后得自己配置launch.json来自己配置调试器。

请问xmake的vscode插件有什么便利的方法来调试程序吗?
当然我理想中,只要配置好xmake.lua,在vscode中就可以自己完成intelligence或者debug的相关配置。

谢谢。

vscode远程连接有时图标无法启用

描述问题

在Windows下使用vscode远程连接Linux时,xmake的编译、debug等图标不可用。使用crtl+shift+p调用xmake:build xmake:debug等也没有反应。

相关环境

  • xmake版本:2.5.5
  • xmake运行平台: Ubuntu 18.04
  • xmake目标平台:Ubuntu 18.04
  • vscode宿主机:windows10

理论上应当与xmake和操作系统、vscode等的版本无关。在使用xmake的两年中,频繁出现过相同问题。且重新安装xmake的插件也是无效的。

其他信息

最近一次出现问题的原因是,我安装了zsh。然后使用在Windows下使用vscode远程连接服务器之后出现了xmake插件无法使用的情况。且没有任何报错提示。

我不是清楚xmake插件那边的逻辑。不过在vscode中的命令行里面执行xmake进行编译运行也是可以的。理论上xmake的路径是可以被搜索到的。

Debug session pause on entry

When starting a debugging session with XMake: Debug, the program is paused on entry. Is there a way to disable this behavior? If there isn't, it would be nice to add this option. In programs debugged with gdb/lldb/etc, in the launch.json configuration, you can set the stopOnEntry field. Because XMake is not run through launch.json, I think it would be reasonable.

If it is okay, I could submit a PR for this.

VS code IntelliSense 问题

Note: If it is a 'bug report' or 'feature request', please select the corresponding issue template, otherwise this issue will be not replied.

Describe the problem details

Please describe your problem details here.

在VS code 中 C++ 源文件 如下
bool cPlcManager::ReadMtrCtrl( 中的 :: 会被标记为 红色波浪线

请问在 c_cpp_properties.json 文件中应该怎么配置,貌似 IntelliSense 的分析识别并不是很有效果

希望在 vscode 中选择 target 的时候对 target 列表排序

你在什么场景下需要该功能?

在 vscode 环境下,单击状态栏选择一个target的时候,希望能对弹出的target列表进行排序。

描述可能的解决方案

可以按下列顺序排序:
default
all
target 名称首字母排序

描述你认为的候选方案

也可以按脚本中target定义的顺序排序。

其他信息

关于工具链的选择功能

当前的版本中只有选择目标平台target的选项,类似Windows,Linux,macos之类。但是我在Windows下做开发的话电脑上面不仅装了vs 2017的工具链,还装了clang和gcc,如果直接使用插件提供的选项进行编译的话会默认使用vs 2017,而如果要想使用其他的工具链就只能够自己写脚本或者配置task实现。
希望能够加入一个类似vscode插件cmake-tools的工具链的选择功能,能够扫描机器上面的工具链并且列出来以供选择,这样就方便许多。

有没有办法得到编译目标的路径

比如...\test_lib\build\windows\x64\debug\test_lib_demo.exe,可以的话就可以很方便地集成到vscode,从而利用vscode的调试机制
如果不行,加一个xmake get_config target_path怎么样?

插件自动生成的compile_commands.json没有包含QT相关的头文件路径

!!! 注:提问题时若使用不能用/没效果/有问题/报错此类模糊表达,但又没有根据下面的模板给出任何相关辅助信息的,将会直接标记为 Invalid。

描述问题

插件自动生成的compile_commands.json没有包含QT相关的头文件路径

{
  "directory": "D:\\workspace\\xmake",
  "arguments": ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX64\\x64\\cl.exe", "/c", "/EHsc", "/nologo", 
"/ID:\\workspace\\xmake\\build\\.gens\\xmake\\windows\\x64\\debug\\rules\\qt\\ui", 
"/Fobuild\\.objs\\xmake\\windows\\x64\\debug\\src\\main.cpp.obj", "src\\main.cpp"],
  "file": "src\\main.cpp"
},

期待的结果

使用命令xmake project -k compile_commands生成的compile_commands.json包含了Qt的头文件路径

{
  "directory": "D:\\workspace\\xmake",
  "arguments": ["C:\\Program Files (x86)\\Microsoft Visual 
Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX64\\x64\\cl.exe", "/c", "/EHsc", "/nologo", "/Zi", "/FS", 
"/Fdbuild\\windows\\x64\\debug\\compile.xmake.pdb", "/Od", 
"/ID:\\workspace\\xmake\\build\\.gens\\xmake\\windows\\x64\\debug\\rules\\qt\\ui", "/DQT_QML_DEBUG", 
"/DQT_DEPRECATED_WARNINGS", "/DQT_CONCURRENT_LIB", "/DQT_GUI_LIB", "/DQT_WIDGETS_LIB", "/DQT_CORE_LIB", 
"/D_WINDOWS", "/IC:\\Programming\\Qt\\5.12.11\\msvc2017_64\\include\\QtConcurrent", 
"/IC:\\Programming\\Qt\\5.12.11\\msvc2017_64\\include\\QtGui", 
"/IC:\\Programming\\Qt\\5.12.11\\msvc2017_64\\include\\QtGui\\5.12.11", 
"/IC:\\Programming\\Qt\\5.12.11\\msvc2017_64\\include\\QtGui\\5.12.11\\QtGui", 
"/IC:\\Programming\\Qt\\5.12.11\\msvc2017_64\\include\\QtWidgets", 
"/IC:\\Programming\\Qt\\5.12.11\\msvc2017_64\\include\\QtWidgets\\5.12.11", 
"/IC:\\Programming\\Qt\\5.12.11\\msvc2017_64\\include\\QtWidgets\\5.12.11\\QtWidgets", 
"/IC:\\Programming\\Qt\\5.12.11\\msvc2017_64\\include\\QtCore", 
"/IC:\\Programming\\Qt\\5.12.11\\msvc2017_64\\include\\QtCore\\5.12.11", 
"/IC:\\Programming\\Qt\\5.12.11\\msvc2017_64\\include\\QtCore\\5.12.11\\QtCore", 
"/IC:\\Programming\\Qt\\5.12.11\\msvc2017_64\\include", "/IC:\\Programming\\Qt\\5.12.11\\msvc2017_64\\mkspecs\\win32-
msvc", "/Fobuild\\.objs\\xmake\\windows\\x64\\debug\\src\\main.cpp.obj", "src\\main.cpp"],
  "file": "src\\main.cpp"
},

错误信息

相关环境

请提供编译和运行环境信息,下面是一些必须填写的基础信息,便于我们针对性排查问题:

  • xmake版本:xmake v2.5.7+202108290043, A cross-platform build utility based on Lua
  • xmake运行平台:Windows 10
  • xmake目标平台:Windows 10

其他信息

请提供关键的 xmake.lua 配置内容,或者完整 xmake.lua,也可以是其他附加信息帮助我们诊断问题(比如截图,xmake.lua或者可复现的demo),以及你遇到的问题的一些背景信息。

第三方依赖的头文件查找路径

你在什么场景下需要该功能?

require了第三方库,include第三方头文件,但是vscode提示找不到(编译是没问题)

描述可能的解决方案

是不是可以通过解析第三方库的include路径,然后自动添加到vscode的c++ include path里?

描述你认为的候选方案

其他信息

关于运行功能的改进意见

注:提问题时若使用不能用/没效果/有问题/报错此类模糊表达,但又没有根据下面的模板给出任何相关辅助信息的,将绝对不会有任何反馈。

描述问题

目前的运行功能是主动打开一个终端,然后发送输入事件到终端,这里存在很多问题
1 是如果当前终端刚好有内容,则发送过去的输入就会直接尾随到其后,问题很大
2 是(大概是为了避免其他问题导致)发送两个换行符,这样会使得运行后的程序也收到两个换行。。。影响了执行结果
3 是如果vscode打开项目后再创建xmake相关文件,终端就不会自动打开了,然后快捷操作也不能使用了

期待的结果

使用 VSCode 内建的Task机制执行构建和运行命令,具体来说使用类似这个插件的机制去运行:https://marketplace.visualstudio.com/items?itemName=spmeesseman.vscode-taskexplorer

其他信息

请提供其他附加信息帮助我们诊断问题。

工具栏图标建议

  • Record a anonymous图标容易和停止搞混
  • Record a anonymous停止和运行状态如果能更直观一点就更好,刚开始用,看到一个框不知道是停止状态还是点一下会停止,看到一个圈不知道是录制状态还是点一下开始录制
  • Record a anonymous停止图标和运行图标很近,容易引起误会

无法调试

test.cpp

#include <iostream>

int main()
{
    std::cout << "Hello, world!" << std::endl;
    return 0;
}

用工具栏操作,点击编译和运行都可以,但是点击调试不行(无限等待),截图:
2020-05-19_23-14

Version Info

  • XMake (vscode plugin): 1.3.4
  • VSCodium (variant of vscode): 1.45.1
  • OS: Manjaro

“xmake.debuggingTargetsArguments” 不能正确发挥作用

描述问题

“xmake.debuggingTargetsArguments” 不能正确发挥作用

期待的结果

"xmake.debuggingTargetsArguments": {
"tinydb" : ["tiny.db"],
"default": []
},
"xmake.runningTargetsArguments": {
"tinydb" : ["tiny.db"],
"default": []
}
设置完后点击运行run和debug按键,tinydb程序均可以带tinydb的参数(即"tiny.db")运行

错误信息

按照targetName设置对应参数之后点击debug按键,仍然按照 default传参数运行
同时,run按键可以按照tinydb的参数运行。
很奇怪为什么run可以正确传参,而debug不行

相关环境

  • xmake版本:1.4.4
  • xmake运行平台:windows下的wsl
  • xmake目标平台:linux x86_64

工程创建与头文件支持

你在什么场景下需要该功能?

我自己本身有一个工程,目录树如下:
image
这里我是使用cmake进行自动化编译的。当我尝试使用xmake进行工程创建的时候,发现只能在src目录下进行创建,就变成了下面这样:
image
事实上,我希望我的工程应当与src在同级目录。这里产生的问题就有一是我本身就是一个git仓库,但是xmake又帮我创建了一个git仓库,二是我的所有东西都与源文件放在了一起。事实上我希望能够自己定义目录结构。同时进行编译过程中,发现include失败,如下:
image

描述可能的解决方案

或许可以允许用户指定新的目录,并创建目录树如下:
image
同时不要自己创建git仓库。让用户保有更大自主权。另一方面,关于头文件目录希望作者能够解决一下。

能否为package增加intellisense支持

你在什么场景下需要该功能?

add_package添加的package能够在vscode中显示intellisense信息

描述可能的解决方案

目前似乎都是在编译或者手动require时才会编译package,这样的话感觉没法实现根据xmake.lua中的package信息来支持intellisense?

同时安装了mingw64与ming32,无法完成切换的问题

注:提问题时若使用不能用/没效果/有问题/报错此类模糊表达,但又没有根据下面的模板给出任何相关辅助信息的,将会直接标记为Invalid。

描述问题

同时安装了mingw64与mingw32,从x86_64切换到i386时,无法切换到ming32版本,
一直检测的是ming64

期待的结果

能否在这样情况下,自动完成检测切换到mingw32呢?

请提供编译和运行环境信息,下面是一些必须填写的基础信息,便于我们针对性排查问题:

  • xmake版本:v2.5.3
  • xmake运行平台:Win10
  • xmake目标平台:x86_64与i386

插件能否传递出一个程序路径出来

你在什么场景下需要该功能?

打算用于交叉编译单片机程序,然后通过cortex-debug插件来调试,由于cortex-debug指向程序的字段为executable而不是本地程序调试用的program,因此用xmake.customDebugConfig来自定义使用cortex-debug插件的时候,没办法很好设置这个字段(当然可以直接填程序路径,但是这样就失去直接按按钮的便捷性了,例如从debug改为release之后,配置就要改)。

对vscode插件开发不熟,不知道能否插件导出环境变量,然后通过${env XXX}的方式获取?

VSCode使用xmake插件创建项目出错

在windows10,2004企业版下使用VSCode创建 qt.widgetapp 项目出现错误

> Executing task: xmake create -t qt.widgetapp -l c++ -P c:\temp\demo <

create demo ...
error: project directory (C:\temp\demo) is not empty!
The terminal process "C:\Windows\System32\cmd.exe /d /c xmake create -t qt.widgetapp -l c++ -P c:\temp\demo" failed to launch (exit code: 4294967295).

Terminal will be reused by tasks, press any key to close it.

在执行之前确认文件夹为空

C:\Users>xmake l os.emptydir "c:\temp\demo"
true

支持为qt项目提供完善的intellisense

我已经使用过xmake project -k compile_commands生成compile_commands.json文件
但是intellisense无法识别*.ui生成的ui_.h文件
推测是compile_commands.json的includePath不含ui_
.h

使用 Remote - SSH 远程开发无法编译

描述问题

主机: MacOS 10.15.3
服务端: Windows 2019, OpenSSH-Server

Screen Shot 2020-03-17 at 01 55 35

测试代码为xmake创建的基础工程,没有添加其它代码,点底部的 build 报告错误.

> Executing task: xmake -v <

/d : The term '/d' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ /d /c xmake -v
+ ~~
    + CategoryInfo          : ObjectNotFound: (/d:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

我试了下正常在命令行输入xmake则能正常编译.

Screen Shot 2020-03-17 at 02 00 49

Ubuntu18.04,helloWorld 在vscode中使用xmake_vscode无法调试

使用xmake build
xmake run 可以正常使用

在vscode中使用xmake rebuild,然后debug,报错
Stopping due to fatal error: NullReferenceException: Object reference not set to an instance of an object

同时一个新的terminal被自动打开,zsh无法被加载,我的terminal用的是zsh

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.