Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose s:workspace to consumers #78

Merged
merged 1 commit into from
Mar 26, 2024
Merged

Conversation

Smaug123
Copy link
Contributor

It would be nice to be able to read Ionide's state - e.g. I want to bind a command to "build everything", which is essentially "list all projects, shell-escape, concat with " ", and dotnet build the result".

@Smaug123
Copy link
Contributor Author

(OK, apparently in instance 3381942 of "msbuild and/or the dotnet CLI is buggy and/or inconsistent", you can't build multiple targets at once from the command line. But the principle stands.)

@baronfel
Copy link

I completely forgot that this feature was requested - I'll ping the team and see what they think. I think it makes sense to enable given that the MSBuild APIs support it

@Smaug123
Copy link
Contributor Author

By the way, this is the Massive Hack I'm currently using to get the loaded projects from Ionide:

-- MASSIVE HACK - raised https://github.com/ionide/Ionide-vim/pull/78
local function captureLoadedProjects()
    vim.fn.execute('redir => g:massive_hack_patrick_capture')
    vim.fn.execute('call fsharp#showLoadedProjects()')
    vim.fn.execute('redir END')
    local output = vim.fn.eval('g:massive_hack_patrick_capture')

    local projects = {}

    for line in output:gmatch("[^\r\n]+") do
        local project = line:gsub("^%s*-%s*", "")
        table.insert(projects, project)
    end

    return projects
end

@cannorin cannorin merged commit d94dd8f into ionide:master Mar 26, 2024
@Smaug123 Smaug123 deleted the patch-1 branch March 26, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants