Giter Site home page Giter Site logo

[New package]: prolog about mason.nvim HOT 6 OPEN

williamboman avatar williamboman commented on July 22, 2024 1
[New package]: prolog

from mason.nvim.

Comments (6)

williambotman avatar williambotman commented on July 22, 2024

Hello! Cool! Pull requests are always very welcomed to add new packages. If the distribution of the
package is simple, the installation will most likely be so as well (existing package installers may be
used for reference!). Otherwise, @williamboman will get around to looking into this ASAP!

from mason.nvim.

Spaceface16518 avatar Spaceface16518 commented on July 22, 2024

Has this been worked on yet? I need to use Prolog for a College class and I want to use my neovim setup. Can I take this on? @williamboman

from mason.nvim.

ignamartinoli avatar ignamartinoli commented on July 22, 2024

@Spaceface16518 I don't know exactly how to tackle this issue.

The way I use to get linting is running

:lua vim.lsp.start { name = 'prolog_lsp', cmd = { 'swipl', '-g', 'use_module(library(lsp_server))', '-g', 'lsp_server:main', '-t', 'halt', '--', 'stdio' } }

Currently I'm not sure of the existence of some autocompletion engine for Prolog

from mason.nvim.

Spaceface16518 avatar Spaceface16518 commented on July 22, 2024

I'd be fine with just linting, maybe with snippets from luasnip or something. Do we discourage adding an lsp server to Mason if it doesn't include proper autocomplete yet?

from mason.nvim.

williamboman avatar williamboman commented on July 22, 2024

Has this been worked on yet? I need to use Prolog for a College class and I want to use my neovim setup. Can I take this on? @williamboman

Sure! I see that it's distributed as a SWI-Prolog package, for which there is no manager yet in Mason, so adding this would require some extra additional work (see for example lua/mason-core/managers/npm/init.lua). A requirement for a "manager" to be supported is that it can ensure that installations can be done entirely locally in a directory managed by Mason - a quick look into pack_install/2 suggests that this is possible.

I'm currently working on migrating things to https://github.com/mason-org/mason-registry, so any new managers and whatnot will need to be ported to a completely new implementation, but that's fine and I'd be happy to do that should it be needed.

from mason.nvim.

ignamartinoli avatar ignamartinoli commented on July 22, 2024

@williamboman @Spaceface16518

This module implements code completion, based on defined predicates in the file & imports.

I just checked and we get auto-completion only for rules defined in the document with the following snippet

require 'lspconfig.configs'['prolog_lsp'] = {
	default_config = {
		cmd = {
			'swipl',
			'-g', 'use_module(library(lsp_server)).',
			'-g', 'lsp_server:main',
			'-t', 'halt',
			'--', 'stdio'
		},
		filetypes = { 'prolog' },
		root_dir = require 'lspconfig.util'.root_pattern('pack.pl')
	},
	docs = {
		description = [[
			https://github.com/jamesnvc/prolog_lsp

			Prolog Language Server
		]]
	}
}

require 'lspconfig'['prolog_lsp'].setup {}

The tricky part

I'm not sure how could I import the built-in predicated into the LSP scope so that one would get auto-completion when typing, for example, findall.
It would be nice to have mainly for mason-lspconfig.
Any idea is appreciated.

from mason.nvim.

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.