Add elm support

Hey there,
it would be awesome to get Elm support via https://github.com/elm-tooling/elm-language-server
I tried this config, but that doesn't seem to be enough:
	"clients":
	{
		"elm-language-server":
		{
			"command":
			[
				"elm-language-server"
			],
			"enabled": true,
			"languageId": "elm",
			"scopes":
			[
				"source.elm"
			]
		}
	}

Thanks

Did you try this command too?
"command": ["elm-language-server", "--stdio"],

Hrm, I think my problem might be that the file doesn't even get recognized as an elm file? Do I need another extension just to get that working, as I can't choose elm from the file type selector.

Yes, first order of business would be to have an Elm syntax. You'll probably also need to set the "syntaxes" key of your "client" config to the path of that Elm syntax, once installed. Although I don't use the Elm language personally, I browsed around a bit and found this one: https://github.com/elm-community/SublimeElmLanguageSupport/blob/master/Syntaxes/Elm.sublime-syntax
(from: https://packagecontrol.io/packages/Elm Language Support)
It looks like this Elm plugin tries to do a lot more than just syntax-highlighting, unfortunately.

Yeah, it's a full blown plugin, so I would need a plugin that just does syntax highlighting?

so I would need a plugin that just does syntax highlighting?

Well, you could also use the plugin mentioned above. I don't know if any functionality might interfere with each other. But in theory all you need is a .sublime-syntax file.
I haven't tested this, but when using that plugin your config should look something like this:
    "elm-language-server":
    {
      "enabled": true,
      "command": ["elm-language-server", "--stdio"],
      "scopes": ["source.elm"],
      "syntaxes": ["Packages/Elm Language Support/Syntaxes/Elm.sublime-syntax"],
      "languageId": "elm"
    },

here are the config that works for me.
"elm":
{
	"command":
	[
		"elm-language-server",
		"--stdio"
	],
	"enabled": true,
	"languageId": "elm",
	"scopes":
	[
		"source.elm",
	],
	"syntaxes":
	[
		"Packages/Elm Language Support/Syntaxes/Elm.sublime-syntax"
	],
	"initializationOptions": {
		"runtime": "node",
			"elmPath": "elm",
	        "elmFormatPath": "elm-format",
	        "elmTestPath": "elm-test"
	},
}

And you need to install Elm Language Support from package control for syntax highlighting, as it doesn't come with the default sublime installation.
I tried elm language server, but as far as I can see only the diagnostics are working.
I would need to see why :)

If you can dig into it, that would be awesome. As we don't seem to be able to figure it out: https://github.com/elm-tooling/elm-language-server/issues/99

Here is a sample elm project if someone is interested in debugging this:
In LSP-settings enable:
"log_debug": true,
"log_payloads": true,
"log_stderr": true,

Next, in the terminal:
//install elm
npm install -g elm elm-test elm-format @elm-tooling/elm-language-server

// setup an example elm project
git clone https://github.com/evancz/elm-architecture-tutorial.git
cd elm-architecture-tutorial
subl .

Here is what happens when I open an elm file:
LSP: starting ['elm-language-server', '--stdio']
LSP:  --> initialize
LSP: window 3 added session elm
LSP: Unhandled notification window/logMessage
LSP: Unhandled notification window/logMessage
LSP: Unhandled notification window/logMessage

// lot of unhandled `window/logMessage`...

LSP: Unhandled notification window/logMessage
LSP: Unhandled notification window/logMessage
LSP: Unhandled notification window/logMessage

// finaly we get a response back from the server and see what the server capabilities are
// NOTE here that the `completionProvider` is an empty dict

LSP:      {'capabilities': {'documentFormattingProvider': True, 'workspaceSymbolProvider': True, 'hoverProvider': True, 'referencesProvider': True, 'codeActionProvider': True, 'documentSymbolProvider': True, 'textDocumentSync': 1, 'executeCommandProvider': {'commands': ['elmLS.elmAnalyseFixer', 'elmLS.elmAnalyseFixer.fixAll']}, 'renameProvider': True, 'codeLensProvider': {'resolveProvider': True}, 'completionProvider': {}, 'definitionProvider': True, 'foldingRangeProvider': True}}
LSP:  --> initialized
LSP:  --> textDocument/didOpen

// Another unhandled request for `client/registerCapability`

LSP: <--  client/registerCapability
LSP:      {'registrations': [{'registerOptions': {}, 'method': 'workspace/didChangeConfiguration', 'id': '0384bd6e-7154-40e7-a252-c66cb266c90e'}]}
LSP: Unhandled request client/registerCapability
LSP: <--  textDocument/publishDiagnostics
LSP:      {'uri': 'file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm', 'diagnostics': []}

I made a NOTE that the completionProvider is an empty dict.
https://github.com/tomv564/LSP/blob/99c2493bb98bc7a57499a85cb659e40026b971b7/plugin/completion.py#L73-L77
Here we get the completionProvider from session.get_capability( 'completionProvider').
The return value is an empty dict,
which means that if completionProvider: is always False in this case.
A Solution for this is to ask if completionProvider is not None:

Another thing that I noticed is
as soon as I start typing,
I get error messages like this:
LSP:  --> textDocument/didChange
LSP: <--  textDocument/publishDiagnostics
LSP:      {'uri': 'file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm', 'diagnostics': []}
elm: Changed text document, going to parse it. file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm
(node:21154) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm':
at Object.openSync (fs.js:438:3):
at Object.readFileSync (fs.js:343:35):
at ASTProvider.<anonymous> (/home/predrag/.npm-global/lib/node_modules/@elm-tooling/elm-language-server/out/providers/astProvider.js:24:42):
at Generator.next (<anonymous>):
at /home/predrag/.npm-global/lib/node_modules/@elm-tooling/elm-language-server/out/providers/astProvider.js:7:71:
at new Promise (<anonymous>):
at __awaiter (/home/predrag/.npm-global/lib/node_modules/@elm-tooling/elm-language-server/out/providers/astProvider.js:3:12):
at DocumentEvents.ASTProvider.handleChangeTextDocument (/home/predrag/.npm-global/lib/node_modules/@elm-tooling/elm-language-server/out/providers/astProvider.js:19:53):
at DocumentEvents.emit (events.js:194:15):
at DocumentEvents.connection.onDidChangeTextDocument.event (/home/predrag/.npm-global/lib/node_modules/@elm-tooling/elm-language-server/out/util/documentEvents.js:7:58):
(node:21154) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2):
LSP:  --> textDocument/codeAction
LSP:      []

Changed text document, going to parse it. file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm
(node:21154) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm':

This is all I could figure out for now,
And I would love is someone else could have a look at this :)

I would like to note that the "unhandled notification" messages from window/logMessage seem correct. Quoting from the specification:

Until the server has responded to the initialize request with an InitializeResult, the client must not send any additional requests or notifications to the server. In addition the server is not allowed to send any requests or notifications to the client until it has responded with an InitializeResult

Until the server has responded to the initialize request with an InitializeResult, the client must not send any additional requests or notifications to the server. In addition the server is not allowed to send any requests or notifications to the client until it has responded with an InitializeResult,with the exception that during the initialize request the server is allowed to send the notifications window/showMessage, window/logMessage and telemetry/event as well as the window/showMessageRequest request to the client.

:D

@rwols do you think that the UnhandledPromiseRejectionWarning is a server related problem?

:D

I guess I should read more than one sentence ahead :)

do you think that the UnhandledPromiseRejectionWarning is a server related problem?

It seems to be coming from Object.readFileSync which is a Node.JS thing. I don't know Javascript.

You don't know JavaScript, I don't know JavaScript... Nobody knows :D
This is what sublime sends to the server for the textDocument/didChange.
DidChangeTextDocumentParams
{
  'contentChanges': [{'text': '...'}],
  'textDocument': {
    'uri': 'file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm',
    'version': 1
  }
}

Here is what happens when I try to readFileSync the "'file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm" file in node.
> fs.readFileSync('file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm')
{ Error: ENOENT: no such file or directory, open 'file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm'
    at Object.openSync (fs.js:438:3)
    at Object.readFileSync (fs.js:343:35)
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path:
   'file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm' }

// If I remove the `file://`, `readFileSync` works.

> fs.readFileSync('/home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm')
<Buffer 69 6d 70 6f 72 74 20 42 72 6f 77 73 65 72 0a 69 6d 70 6f 72 74 20 48 74 6d 6c 20 65 78 70 6f 73 69 6e 67 20 28 48 74 6d 6c 2c 20 41 74 74 72 69 62 75 ... >
>

hello @Razzeee,
I think (I might be wrong, but) that the elm server need to handle textDocument uri correctly when it contains file://  :)

I think it does. Here's a screenshot from me debugging the VSCode version.
Take it with a grain of salt as it's against master.

And yes, startup is a mess. Sorry for that, will work on that. Still I don't think that that should break anything.

Let's summarize the discussion so far:

We should handle empty completionProvider dict (#652)
We should wire up the three special notification handlers before sending the initialize request
There's something fishy going on with with URIs in textDocument/didChange

As it turns out I seem to have the node executable on my machine :)
> fs.readFileSync("/home/raoul/Documents/gintonic2/build/build.ninja")
<Buffer 23 20 43 4d 41 4b 45 20 67 65 6e 65 72 61 74 65 64 20 66 69 6c 65 3a 20 44 4f 20 4e 4f 54 20 45 44 49 54 21 0a 23 20 47 65 6e 65 72 61 74 65 64 20 62 ... >
> fs.readFileSync("file:///home/raoul/Documents/gintonic2/build/build.ninja")
{ Error: ENOENT: no such file or directory, open 'file:///home/raoul/Documents/gintonic2/build/build.ninja'
    at Object.openSync (fs.js:439:3)
    at Object.readFileSync (fs.js:344:35)
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: 'file:///home/raoul/Documents/gintonic2/build/build.ninja' }
> fs.readFileSync(new URL("file:///home/raoul/Documents/gintonic2/build/build.ninja"))
<Buffer 23 20 43 4d 41 4b 45 20 67 65 6e 65 72 61 74 65 64 20 66 69 6c 65 3a 20 44 4f 20 4e 4f 54 20 45 44 49 54 21 0a 23 20 47 65 6e 65 72 61 74 65 64 20 62 ... >
>

wrapping the URI string into a new URL(...) seems to fix the problem.

It would be really helpful to get the logs, that the server sends.
https://github.com/elm-tooling/elm-language-server/blob/master/src/providers/astProvider.ts#L33 is the problematic part, but I can't get master branch with vscode to go into that if branch.
So it seems like your forest var does not get populated.
That should only be able to happen if we fail to find your elm.json in the elmWorkspace path you provided.
https://github.com/elm-tooling/elm-language-server/blob/master/src/server.ts#L129
Did you open the folder that has the elm.json or a parent?
So we should probably set the elmWorkspace. https://github.com/elm-tooling/elm-language-server/blob/master/src/server.ts#L76
Still it's weird that the fallback doesn't work.

I cloned the latest master for elm language server now.
The logs changed a bit, there are less unhandled notification window/logMessage and more of those elm: Adding XXX.elm
LSP: window 2 requests elm for /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm
LSP: starting in /home/predrag/Documents/sandbox/elm-architecture-tutorial
LSP: starting ['node', '/home/predrag/Documents/elm/elm-language-server/out/index.js', '--stdio']
LSP:  --> initialize
LSP: window 2 added session elm
reloading settings Packages/User/Package Syncing.sublime-settings
LSP: Unhandled notification window/logMessage
LSP: Unhandled notification window/logMessage
LSP: Unhandled notification window/logMessage
LSP: Unhandled notification window/logMessage
LSP: Unhandled notification window/logMessage
LSP: Unhandled notification window/logMessage
LSP: Unhandled notification window/logMessage
LSP:      {'capabilities': {'renameProvider': True, 'executeCommandProvider': {'commands': ['elmLS.elmAnalyseFixer-9d69137d73b2fca70605bd7437835365', 'elmLS.elmAnalyseFixer.fixAll-9d69137d73b2fca70605bd7437835365', 'elmLS.elmMakeFixer-7f5de75f6322f494c1e1e6ac61819e73']}, 'codeActionProvider': True, 'referencesProvider': True, 'workspaceSymbolProvider': True, 'definitionProvider': True, 'foldingRangeProvider': True, 'documentFormattingProvider': True, 'textDocumentSync': 1, 'codeLensProvider': {'resolveProvider': True}, 'completionProvider': {}, 'documentSymbolProvider': True, 'hoverProvider': True}}
LSP:  --> initialized
LSP:  --> textDocument/didOpen
(node:17910) [DEP0091] DeprecationWarning: crypto.DEFAULT_ENCODING is deprecated.:
(node:17910) [DEP0010] DeprecationWarning: crypto.createCredentials is deprecated. Use tls.createSecureContext instead.:
(node:17910) [DEP0011] DeprecationWarning: crypto.Credentials is deprecated. Use tls.SecureContext instead.:
LSP: <--  client/registerCapability
LSP:      {'registrations': [{'method': 'workspace/didChangeConfiguration', 'registerOptions': {}, 'id': 'f3644278-ae91-427f-9c62-a60ccfd28075'}]}

// could this be the problem??

LSP: Unhandled request client/registerCapability
elm: initializing - folder: "file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/"
elm: Elm version 0.19.0 detected.
elm: Reading elm.json from /home/predrag/Documents/sandbox/elm-architecture-tutorial/elm.json
elm: 2 source-dirs found
elm: Found 52 files to add to the project
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/01-button.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/02-field.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/03-form.elm
...
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Parser/Internal.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Parser/Query.elm
elm: Done parsing all files.

The UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory is gone,
But the completion still doesn't work (I set if completionProvider is not None:),
Plus, I noticed that the diagnostics are not working now too.

I opened the folder that contains the elm.json file, that can be seen in the log I provided above:
elm: Reading elm.json from /home/predrag/Documents/sandbox/elm-architecture-tutorial/elm.json

I have some news.
I allowed window/logMessage  from the server while initializing.
Here are the logs, notice elm: Starting language server for folder: no workspaceFolders
LSP: starting ['elm-language-server', '--stdio']
LSP:  --> initialize
LSP: window 2 added session elm
elm: Rebuilding tree-sitter for local Electron version
elm: Fetching tree-sitter
elm: Downloading (or using local cache for) https://github.com/tree-sitter/node-tree-sitter/releases/download/v0.14.0/tree-sitter-v0.14.0-node-v64-linux-x64.tar.gz
elm: Fetching tree-sitter-elm
elm: Downloading (or using local cache for) https://github.com/razzeee/tree-sitter-elm/releases/download/v2.2.4/tree-sitter-elm-v2.2.4-node-v64-linux-x64.tar.gz
elm: Rebuild succeeded!
elm: Starting language server for folder: no workspaceFolders
LSP:      {'capabilities': {'codeLensProvider': {'resolveProvider': True}, 'referencesProvider': True, 'hoverProvider': True, 'renameProvider': True, 'definitionProvider': True, 'executeCommandProvider': {'commands': ['elmLS.elmAnalyseFixer-d7294d2dfb41897af7d50f04d1e0ed6a', 'elmLS.elmAnalyseFixer.fixAll-d7294d2dfb41897af7d50f04d1e0ed6a', 'elmLS.elmMakeFixer-0f132a29c6d6968152375ed687c64470']}, 'documentSymbolProvider': True, 'foldingRangeProvider': True, 'codeActionProvider': True, 'completionProvider': {}, 'documentFormattingProvider': True, 'workspaceSymbolProvider': True, 'textDocumentSync': 1}}
LSP:  --> initialized
(node:9690) [DEP0091] DeprecationWarning: crypto.DEFAULT_ENCODING is deprecated.:
(node:9690) [DEP0010] DeprecationWarning: crypto.createCredentials is deprecated. Use tls.createSecureContext instead.:
(node:9690) [DEP0011] DeprecationWarning: crypto.Credentials is deprecated. Use tls.SecureContext instead.:
LSP:  --> textDocument/didOpen
LSP:  --> workspace/didChangeConfiguration
LSP: <--  client/registerCapability
LSP:      {'registrations': [{'id': '5141e58a-f1a7-48e6-aa2e-3649c9a26519', 'method': 'workspace/didChangeConfiguration', 'registerOptions': {}}]}
LSP: Unhandled request client/registerCapability
elm: initializing - folder: "file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/"
elm: Elm version 0.19.0 detected.
elm: Reading elm.json from /home/predrag/Documents/sandbox/elm-architecture-tutorial/elm.json
elm: 2 source-dirs found
elm: Found 52 files to add to the project
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/01-button.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/02-field.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/03-form.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/05-http.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/06-json.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/07-random.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/08-time.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/AnimationManager.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/Dom.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/Events.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/Navigation.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Expando.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/History.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Main.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Metadata.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Overlay.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Report.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Array.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Basics.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Bitwise.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Char.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Debug.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Dict.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Elm/JsArray.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/List.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Maybe.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Platform.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Platform/Cmd.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Platform/Sub.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Process.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Result.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Set.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/String.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Task.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Tuple.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Attributes.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Events.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Keyed.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Lazy.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/http/2.0.0/src/Http.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/json/1.1.1/src/Json/Decode.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/json/1.1.1/src/Json/Encode.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/random/1.0.0/src/Random.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/time/1.0.0/src/Time.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Builder.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Parser.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Parser/Internal.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Parser/Query.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/AnimationManager.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/Dom.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/Events.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/Navigation.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Expando.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/History.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Main.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Metadata.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Overlay.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Report.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Array.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Basics.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Bitwise.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Char.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Debug.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Dict.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Elm/JsArray.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/List.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Maybe.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Platform.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Platform/Cmd.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Platform/Sub.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Process.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Result.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Set.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/String.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Task.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Tuple.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Attributes.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Events.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Keyed.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Lazy.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/http/2.0.0/src/Http.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/json/1.1.1/src/Json/Decode.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/json/1.1.1/src/Json/Encode.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/random/1.0.0/src/Random.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/time/1.0.0/src/Time.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Builder.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Parser.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Parser/Internal.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Parser/Query.elm
elm: Done parsing all files.
LSP: no config found or enabled for view None

Seems to work for me too, at least what I can tell without ever having used an lsp for sublime :)
:confetti_ball:

Well it doesn't work for me
I don't get any errors, but the completions doesn't work, the diagnostics doesn't work...
Nothing is working and I can't figure out why.  :D

Try updating the server version, even if it might "break" things for you. Fingers crossed

Installing the latest version of elm-lanugage-server allows me to start the elm server successfully.
I get diagnostics and code actions :)
But the goto definition, completions, and references seem to work partially (I will write tomorrow what I mean by that)
Anyway @Razzeee thanks :) we are one step closer to bringing elm support to sublime

@predragnikolic ping :)
not trying to bug you, but you might have forgotten about it :)
Also there is a new version of the server you might want to check out.
You can also drop the runtime option with the new version, as it is not needed anymore :)

@Razzeee, thanks for reminding me
I tried it now and yes, it is working now  :)

@predragnikolic
Thank you, would you be willing to help me extend the readme? https://github.com/elm-tooling/elm-language-server#editor-support

@Razzeee I opened a PR for adding elm to the LSP sublime docs :)
You can use that as a reference, but if you need more details, feel free to ping me.

Thank you, added it to the ls docs.
https://github.com/elm-tooling/elm-language-server#sublime
https://github.com/elm-tooling/elm-language-server#editor-support
The only thing that I did not manage to get to work were code lenses.

No, thank you!
Sublime lsp doesn't, yet, support code lens... Yet :-)

Also I spotted a typo in your docs :-D

Firnt install the language server via npm

Fixed

I would like to reopen this, as we should find a solution for https://github.com/elm-tooling/elm-language-server/issues/121

Update: The same setup I had done on Linux, which works,
I did this morning on Mac
the server successfully initializes,
but I get no completion, code actions... only the diagnostics work.

Hrm, no in your case the workspace folder is the root folder you've opend. That case works, it starts to be problematic, if you have multiple elm.json files or a elm.json file that's not in the root folder.

If we implement workspaceFolders (and populate that with Sublime's "project folders") , and we update the instructions for the user to say "make sure the folder where elm.json lives is one of your project folders", then the elm-language-server can iterate those workspaceFolders and search for the elm.json file. Does this strategy sound OK?

The elm language server could also watch for a keyvalue pair in the initializationOptions that points to the elm.json file. I'm not sure wether the initializationOptions can be overridden per Sublime project.

I'm not sure that that's the way to go. At the moment we're doing it the other way around and it seems to also be what other IDE support packages do.
The client decides when to start / stop the server (see Server Lifetime here https://microsoft.github.io/language-server-protocol/specification ) and there is a server for every topmost elm.json we find. Servers starting servers doesn't sound very fitting.

The client decides when to start / stop the server and there is a server for every topmost elm.json we find. Servers starting servers doesn't sound very fitting.

I don't understand what you mean by this sentence. Could you clarify what you're envisioning?
There is one connection maintained to a language-server per language per window. So if you have a window open which contains python files and bash scripts, the plugin will maintain a connection to one instance of the python-language-server, and one instance of the bash-language-server.
The concept of rootPatterns is a workaround for neovim because it doesn't have the concept of (multiple) workspaces, whereas VSCode and ST do have workspaces: https://github.com/neoclide/coc.nvim/wiki/Using-workspaceFolders
There is also the desire to have less configuration options, not more.

AS far as I understood the spec especially the Server Lifetime heading here https://microsoft.github.io/language-server-protocol/specification and the implementation here https://github.com/microsoft/vscode-extension-samples/blob/master/lsp-multi-server-sample/client/src/extension.ts#L104
The client should start a server per workspace, I guess that's already happening now. Our way of thinking about workspaces was probably off. As we thought, we would best only start a server when we're sure that there is an elm.json but maybe it makes sense to let a client still start it and look for an elm.json on the server and either process it or shut down the server again, if we're unable to find one.

Even without an elm.json the server should still try to make useful suggestions IMO.
For example, clangd can work without a compilation database (but not optimally). If the user notices bogus diagnostics he/she can then decide to invest more time into the docs and learn how to set up a compilation database.
The same can be said for elm-language-server.
Besides, with a textDocument/didOpen notification, can't you just walk up the file tree and search for an elm.json file? That's at least what clangd does when trying to find a compile_commands.json file.

Yeah, your right, that would be the best thing to do.

I implemented everything that I think is necessary now, haven't created a release yet, but it's in master. Just FYI.

@Razzeee
Hello I tried again :)
I pulled the latest master
and opened up elm-architecture-tutorial repository in sublime
git clone https://github.com/evancz/elm-architecture-tutorial.git
cd elm-architecture-tutorial
subl .

I opened 07-random.elm the server started to initialize.
After the Elm server initialized.
I got completion suggestions only in one file 04-maybe.elm.
In any other file I got no completions.

From the logs I saw something that maybe relates to this.
Notice the section when elm started to add imports.
It only added imports for /04-maybe.elm.
elm: Adding imports file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm
It didn't add imports for the other files in the project, like 07-random.elm.
(node:17159) [DEP0091] DeprecationWarning: crypto.DEFAULT_ENCODING is deprecated.:
(node:17159) [DEP0010] DeprecationWarning: crypto.createCredentials is deprecated. Use tls.createSecureContext instead.:
(node:17159) [DEP0011] DeprecationWarning: crypto.Credentials is deprecated. Use tls.SecureContext instead.:
elm: Elm version 0.19.0 detected.
elm: Reading elm.json from /home/predrag/Documents/sandbox/elm-architecture-tutorial/elm.json
elm: 2 source-dirs and test folders found
elm: Found 52 files to add to the project
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/01-button.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/02-field.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/03-form.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/05-http.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/06-json.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/07-random.elm
elm: Adding /home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/08-time.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/AnimationManager.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/Dom.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/Events.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/Navigation.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Expando.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/History.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Main.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Metadata.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Overlay.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Report.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Array.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Basics.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Bitwise.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Char.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Debug.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Dict.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/List.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Maybe.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Platform.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Process.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Result.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Set.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/String.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Task.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Tuple.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Elm/JsArray.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Platform/Cmd.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Platform/Sub.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Attributes.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Events.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Keyed.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Lazy.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/http/2.0.0/src/Http.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/json/1.1.1/src/Json/Decode.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/json/1.1.1/src/Json/Encode.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/random/1.0.0/src/Random.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/time/1.0.0/src/Time.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Builder.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Parser.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Parser/Internal.elm
elm: Adding /home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Parser/Query.elm
elm: Adding imports file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/04-maybe.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/AnimationManager.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/Dom.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/Events.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Browser/Navigation.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Expando.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/History.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Main.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Metadata.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Overlay.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/browser/1.0.0/src/Debugger/Report.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Array.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Basics.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Bitwise.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Char.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Debug.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Dict.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/List.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Maybe.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Platform.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Process.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Result.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Set.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/String.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Task.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Tuple.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Elm/JsArray.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Platform/Cmd.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/core/1.0.2/src/Platform/Sub.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Attributes.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Events.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Keyed.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/html/1.0.0/src/Html/Lazy.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/http/2.0.0/src/Http.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/json/1.1.1/src/Json/Decode.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/json/1.1.1/src/Json/Encode.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/random/1.0.0/src/Random.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/time/1.0.0/src/Time.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Builder.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Parser.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Parser/Internal.elm
elm: Adding imports file:///home/predrag/.elm/0.19.0/package/elm/url/1.0.0/src/Url/Parser/Query.elm
elm: Done parsing all files.
elm: Received open for file:///home/predrag/Documents/sandbox/elm-architecture-tutorial/examples/07-random.elm
elm: Diagnostics were requested due to a file open or save
Package Control: Skipping automatic upgrade, last run at 2019-08-20 23:23:25, next run at 2019-08-21 00:23:25 or after

BTW, the Elm Language Support is no longer on package control.
so I installed Elm Syntax Higlighting.
Here is my lsp elm config:
"elm": {
    "command": [
        "node",
        "/home/predrag/Documents/elm/elm-language-server/out/index.js",
        "--stdio"
    ],
    "enabled": true,
    "languageId": "elm",
    "scopes":
    [
        "source.elm"
    ],
    "syntaxes":
    [
        "Packages/Elm Syntax Highlighting/src/elm.sublime-syntax"
    ],
    "initializationOptions": {
        "elmPath": "elm",
        "elmFormatPath": "elm-format",
        "elmTestPath": "elm-test"
    }
},

The files in that project do not have module declarations, that's a case, that we don't handle well. So that seems to be the reason.
Yes, the package has been renamed. I already updated the readme in master https://github.com/elm-tooling/elm-language-server#sublime
Thank you for looking at this.

Updated our documentation pointing to the new syntax package as well. Closing as it appears to be working in general, for specific Sublime-related discussions please open a new issue.


[BUG] Add-PnPField (also Add-PnPFieldFromXml)

PnP.Powershell
Attempt to create a site column using Add-PnPField  with an ampersand in the Internal Name
eg. "test&"
$displayName = "test&"
$internalName = $displayName
$fldObj = Add-PnPField -DisplayName $displayName -InternalName $internalName -Type "Text"
Expected behavior
Site Column should be created
If you use the SharePoint GUI it allows the column to be created
Create New Site column , creates a new site column with the following attributes:
display name is "test&" and internal name is "test_x0026_" and static name is "test_x0026_"
Actual behavior
an error is thrown "An error occurred while parsing EntityName"
$displayName = "test&"
$internalName = $displayName
$fldObj = Add-PnPField -DisplayName $displayName -InternalName $internalName -Type "Text"
Add-PnPField : An error occurred while parsing EntityName. Line 1, position 31.
At line:7 char:11

$fldObj = Add-PnPField -DisplayName $displayName -InternalName $inter ...

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CategoryInfo          : WriteError: (:) [Add-PnPField], ServerException
FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Fields.AddField

Steps to reproduce behavior
$displayName = "test&"
$internalName = $displayName
$fldObj = Add-PnPField -DisplayName $displayName -InternalName $internalName -Type "Text"
Add-PnPField : An error occurred while parsing EntityName. Line 1, position 31.
At line:7 char:11

$fldObj = Add-PnPField -DisplayName $displayName -InternalName $inter ...

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CategoryInfo          : WriteError: (:) [Add-PnPField], ServerException
FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Fields.AddField

What is the version of the Cmdlet module you are running?
1.11.59
Which operating system/environment are you running PnP PowerShell on?

Windows 10

Hi @jasmeeners , unfortunately we can't fix this issue from our end.
We use CSOM SDK underneath to create fields from XML.
This is one of those weird SharePoint issues where the UI uses different API and the code uses a different one.
This is also reproducible outside of PnP PowerShell itself when used directly via CSOM.
If it is a major issue, would request you to raise that with Microsoft support and mention that there is a problem with CSOM when creating fields.
We wont be able to fix it from the PnP PowerShell side, so will have to close it.


Precompiled version of react-dnd not found

I tried to use the precompiled version of react-dnd. But it's not found in the npm and also in the given FAQ url.
http://react-dnd.github.io/react-dnd/docs/faq
Kindly add the precompiled js.

https://www.npmjs.com/package/react-dnd-umd-builds


[UOT-145550] Updates to Organization Details page to incorporate Org Head and Org Type(s) information in table

Description:
This PR adds in additional attributes/relationships data into the Organization Details page based on additions to the graph (namely the Organization's Head and Organization Types information). This branch has been tested locally against both a local version of neo4j graph as well as the dev neo4j graph.
A screenshot of the updates (the table on the left hand side has been updated to add Org Head and Org Type(s).

@JLyons1985 @britton-jason @jram930 Code updated with missing data checks, and also consolidated code a bit, everything runs good on my end as well

Requesting re-review


Classes inheriting from [System.Attribute] cannot be defined and used in the same PowerShell module

Steps to reproduce
set-StrictMode -Version 'Latest'
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
[AttributeUsage([AttributeTargets]::Property)]
class TestAttribute : System.Attribute {
}
class TestClass {
[int] [TestAttribute()] $i = 5
}
S C:\Users\scbaker> Import-Module E:\tmp\Test-Module2.psm1
Import-Module : The invoked member is not supported before the type is created.
At line:1 char:1

Import-Module E:\tmp\Test-Module.psm1

CategoryInfo : NotSpecified: (:) [Import-Module], NotSupportedException
FullyQualifiedErrorId : System.NotSupportedException,Microsoft.PowerShell.Commands.ImportModuleCommand

Scotia Baker:
Because class names aren't visible outside their defining module, the only workaround I've found is using Add-Type (zip of files attached).  Defining the attribute in another module using PS5 class support does not work due to lexical scoping of class names.
ISSUE:
A custom attribute class cannot be defined and used within the same PowerShell module.
IMPACT:
(1) Debug time diagnosing the issue.  The import failure does not say what member or type is involved, making debugging difficult.
(2) An extra module must be created to define attribute classes regardless of logical code layout.
The primary impact is in the debugging time; an extra module may be ugly but it's easy enough.  A fix for the issue is of course preferred.

TFS:7336218


lint: Lint all

:tada: This PR is included in version 1.6.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


FancyZones not snapping certain programs

Microsoft PowerToys version
v0.65.0
Installation method
Microsoft Store
Running as admin
Yes
Area(s) with issue?
FancyZones
Steps to reproduce
I've used this program for a while and it never seems to work with RuneLite. It just refuses to interact with it via FancyZones. There is no zones shown when trying to snap it into a zone.
✔ Expected Behavior
When pressing Shift & drag - Zones to show up for Runelite, allowing me to snap it into a zone without any exp loss.
❌ Actual Behavior
When pressing Shift & drag - no zones are present when trying to drag the application RuneLite. Works with most other applications.
Other Software
RuneLite v1.9.6

I don't know if this might be caused by runelite itself, but the workaround is opening runelite, going to "configuration > runelite > window settings > untick enable custom window chrome".
After doing that it works as expected. Hope this helps.

I don't know if this might be caused by runelite itself, but the workaround is opening runelite, going to "configuration > runelite > window settings > untick enable custom window chrome".
After doing that it works as expected. Hope this helps.

I don't have runelite on my PC that I can find!


Docs: update documentation js examples, using es6

edit:
Ref: https://github.com/twbs/bootstrap/issues/32096

@GeoSot Is there anyway we can lint these snippets? I believe we have an issue open to suggest this, but I'm not sure of how we could accomplish it off the top of my head.

Is there anyway we can lint these snippets?

A few thoughts:
As mentioned in https://github.com/twbs/bootstrap/issues/32096, eslint-plugin-markdown looks promising. The equivalent for HTMl seems to be eslint-plugin-html. Without trying, these seem the best solution.
Alternatively a regex something like:
```js((.|\n)*)```

should(?) match JS code blocks in markdown.
And for HTML:
<script>((.|\n)*?)<\/script>

could work with a bit of tweaking.
You could then run the matched strings through ESLint to flag issues. (See https://eslint.org/docs/developer-guide/nodejs-api#linter)

I made a try, but any suggestions here are welcome, as I don't have the expertise

Had a quick look through and LGTM. The linter seems to work pretty well too.
The <!-- eslint-skip -->  comments will be outputted into the site - not really an issue but might be nice to avoid if there's a way?


Error deploying web hook: Error: url not unique

We keep getting this each time we go to sync one with specific team on Linear.  Other teams work, but not this one specific one.  The error message isn't giving me enough information to fix it.  Anyone have any ideas?

I tried to set this up a few times and forgot to remove the old webhook on Linear. Removing it fixed the issue.


Pipeline commit message is not complete

The build workflows of the target repositories have the following code for creating a commit message:
git commit -m "build triggered by submodule ${{ inputs.repository }} version ${{ inputs.branch }}"

However the inputs.repository and inputs.branch variables are not added to the actual commit message, see for example :
https://github.com/openMetadataInitiative/openMINDS_JSON-Schema/commit/2628169cc48eaa69a020a93f9e9463e59d409077

Following up on this:
"Module" repositories, i.e openMINDS_core provides some inputs (branch_name, repository_name) to the build action of openMINDS/pipeline.
The build action uses these inputs to create a commit message like this:

build triggered by submodule openMetadataInitiative/openMINDS_stimulation version v1

However, these input arguments are not propagated to any of the target repositories' build action (and I don't know if that is possible), but all the target repositories have the same command for pushing in their build action, i.e:
git commit -m "build triggered by submodule ${{ inputs.repository }} version ${{ inputs.branch }}"

@olinux can we have a look at this together?


Seachbar Updated1

Related Issuse
fix #1966
Describe the changes you've made
Searchbar Updated
Checklist:

[x] My code follows the style guidelines of this project.
[x] I have performed a self-review of my own code.
[x] My changes generate no new warnings.

@sairish2001 I am not able to merge conflicts i will open this PR again :)


Review MIP task: make it work by ROI? Make it work at the whole-plate level?

The MIP task currently works on the entire zarr array, because it is not based on any per-FOV processing.
For optimization purposes, we can decide to make it work on the available FOV ROIs only. If the array of FOVs is very sparse, there could be a significant advantage time-wise.
EDIT: this is to be assessed carefully, because at the moment it is written in a way which is quite optimized for dask to handle all the whole array at the same time, while per-ROI processing would scan ROIs sequentially.

Based on last week meetings, and related to https://github.com/fractal-analytics-platform/fractal-tasks-core/issues/279#issuecomment-1637522831, there is also the possibility of going the opposite way: instead of moving towards per-ROI operations, could we move away from the pair of prepare&fill tasks and simply have an MIP task that does everything at the plate level? It would be an expensive task, that's for sure, but it probably would play well with internal (dask multithreading) parallelization. It's true however that splitting on multiple nodes is useful in terms of memory.
To be discussed, and/or tested with some real data.
The obvious benefit would be simplifying the user flow (one MIP task, instead of a pair of fill&prepare tasks), but we should make sure that this scales decently with the dataset size.

It would be an expensive task, that's for sure, but it probably would play well with internal (dask multithreading) parallelization.

Let's test it on some real data. We could add max projection functionality to the data copying in the copy ome zarr task (see https://github.com/fractal-analytics-platform/fractal-tasks-core/issues/279) and then compare the performance. For most cases, that is probably the best way to go. We can then test on the 23 well dataset (1TB 3D images) and on some other 384 well datasets. I could also imagine that we may want to keep the option to do MIP per well (but not per ROI, I'd agree here), but not encourage it by default

Closing in favor of #558 (which goes in the opposite direction, that is, trying to fully remove ROIs from the MIP task)


Add new fields to WorkflowLevel2

Purpose
Adds required fields for WorkflowLevel2
Related ticket: https://github.com/Humanitec/ActivityAPI/issues/139

Coverage increased (+0.03%) to 58.539% when pulling 45f3f353194588bf52ce5e434be8f42e2d863b59 on Menda:139-new-wflvl2-fields into 45388a61019340359a18805732060a8c0a51adf0 on toladata:dev-v2.


How to Set the Array Field's Value, with a Value From Another Collection and Generate the Proper Number of ArrayFields to Match Loop Iterations?

If possible I would like some help implementing or suggestions with the following… I have two Collections, Responses and Questions. I’m looking to take the value of question (from Questions) and place it as the value of quiz.question (in Responses).

Decided to use a custom template for the arrayfield.


1.16 breaks scaling between card sections

Checklist:

[ X] I updated to the latest version available
[ X] I cleared the cache of my browser

Release with the issue:
1.16.x
Last working release (if known):
1.15.x
Browser and Operating System:
Win11 Moment 4, Edge 118.0.2088.46 (Official build) (64-bit)

ALL
Description of problem:
Scaling off segments between sections changed between versions - Please revert to 1.15 scaling behavior or provide override option

This picture is 'correct' taken in 1.15.1

This is in 1.16.1 (1.16.0 also shows inconsistent bar scaling as well)

Not fixed in 1.17:

Specifically look at section 5, second item - IT Closet  Trace that back one step - What the heck is going on there? why are the lobes changing size?  I expect that bar once it breaks off - to maintain relative width  0.97KwH should be represented as the same amount relative to the unit - not relative to the percent visible on a 100% bar
It looks like you're trying to scale the window to 100% top/bottom for each - NO stack the energy values based on the smallest unit displayed and the chart height is the chart height  please see the first.

Ah, I think I see where the problem is. Will fix in next version

fixed in 1.17.1:


New UI of the language popover

The language seletion menu looks out-of-style compared to other modern GNOME apps, and is awkward with few languages. A good source of inspiration would be e.g. Dialect's language popover.

Source


fix: subscription configuration mixup

The pubUpdate and pubDelete configuration were mixed up causing issues in subscriptions not being
fired up
Fixes #1351

/cc @lastmjs this should fix the issue.


[wip] looking at post processing

Testing some changes to postcss configuration.
Copied postcss.config.js from docsy theme.
Do not merge.

/close


ModelicaStrings.c does not compile on dSPACE targets

Reported by beutlich on 18 Sep 2013 13:35 UTC
After a78ddd1b30c6380ef1464f369391839638d6960b for #1151 ModelicaStrings.c does no longer compile for dSPACE DS1006. I asked dSPACE Support about the other targets I cannot test.
Attached is a hotfix for the DS1006.

Migrated-From: https://trac.modelica.org/Modelica/ticket/1273

Comment by beutlich on 24 Sep 2013 12:47 UTC
Resolved by<PHONE_NUMBER>541df38692ed9b3cc515c320dbd1ce.

Comment by dietmarw on 24 Sep 2013 13:19 UTC
That patch looks like a very bad hack. Isn't there a better way of doing this without having to specify all future devices of different manufacturers?

Comment by beutlich on 24 Sep 2013 14:43 UTC
Replying to [comment:2 dietmarw]:

That patch looks like a very bad hack. Isn't there a better way of doing this without having to specify all future devices of different manufacturers?

Your are right. We tried to find a generic solution but did not succeed. The DS1006 is the only dSPACE board where __linux__ (or __gnu_linux__ if you like) and __GLIBC__ are defined but the locale-dependent versions of strtod and strtol are missing (even if compiled with -std=gnu99).

Comment by beutlich on 17 Oct 2013 08:22 UTC
I checked several glibc releases from ftp://ftp.gnu.org/gnu/glibc/ and noticed that the locale-dependent versions of strtod and strtol first occur in \include\stdlib.h of glibc 2.3. The dSPACE DS1006 GCC environment uses older glibc 2.2. I propose to replace the bad hack for _DS1006 by appropriate checks for __GLIBC__ and __GLIBC_MINOR__.

Comment by beutlich on 17 Oct 2013 09:51 UTC
Resolved by 1f088249219126fe67d70f0bd6b26886f7998d76 and 3fa1b5261c3a4f7f08b94a8c1cc4fd6b23eada09.

Comment by beutlich on 17 Oct 2013 14:24 UTC
Last commit breaks compilation on Cygwin and MinGW.

Comment by beutlich on 17 Oct 2013 14:33 UTC
Resolved by 8a6439abd20271b6d344d9f58e0a797bdccd6723 and 6d32054f082ef16dd594e7d5d41a53c3f6e0fa67.

Modified by dietmarw on 15 Nov 2013 13:37 UTC

Modified by beutlich on 11 Jun 2014 08:39 UTC

Changelog modified by beutlich on 11 Jun 2014 08:39 UTC
Fixed compilation of ModelicaStrings on dSPACE DS1006


State Machine race for async clients

When an async client resumes, it first reads the current state and the state machine object and fast-forwards to the current cycle. This is buggy if another thread simultaneously start a new state machine --- the async thread will capture the new state machine, but believe it to be in the old cycle, because the state it sees is REST, and it cannot differentiate between REST being the end of the last cycle and the beginning of the new cycle. Depending on the state machine being swapped in, the failure can lead to crashes or non-termination of the state machine logic.
The fix should involve capturing the state machine object in session context before suspending a thread.

Related latency (not correctness) issue:  a thread during OnThreadState in the state machine accesses global FASTER-level information such as faster._hybridLogCheckpoint. If the thread were a catch-up thread, this information may in fact pertain to the future, such as a future faster._hybridLogCheckpoint.info.finalLogicalAddress. This would cause the late thread to spin while catching up, until the ongoing (future) condition is satisfied.


[Bug]:

Minecraft Version
1.17.1
Mod Version
0.0.3
Is Compressium Loaded
Not Loaded
What happened?
When you place blocks like Cobblestone Block 1x, it cannot be removed. They can be pistoned around but not mined/recovered. This is on the official All The Mods 7 server
latest.log
no

Fixed in 0.0.4


Improved simulated-annealing.cpp

The new implementation offers significant advantages over the previous one. Instead of duplicating everything, it uses rollback, enabling faster iterations and reduced memory usage. This approach also provides an automatic way to adjust the temperature function based on the time limit. Furthermore, it allows the same representation to be reused for future simulated annealing attempts, making the process more efficient and adaptable.

lgtm!


[8.x] Fixes middleware() not accepting Stringable

What?
Fixes declaring routes as Route::get()->middleware() with Stringable objects. As seen on TV:

I may need to revert this already @DarkGhostHunter
This simple test doesn't even work locally:

Originally posted by @taylorotwell in https://github.com/laravel/framework/issues/39439#issuecomment-957792825

This also removes son unnecessary checks for middleware declaration, as is expected to be an array, or a string (which gets converted to a one-member array anyway).

Can someone explain why test fails because of yes?

Ty. Please don't crash now.

Thanks

👌


Short send on Win32 Winsock used to redirect stdout of CreateProcess() to a WSL socket

Hi,
I've written a small tool able to launch Win32 programs from WSL using TCP sockets, that can also redirect standard handles of spawned Win32 processes to WSL using yet other sockets ending on the WSL side (and then the stream is forwarded to WSL std fds by the caller tool). On the Win32 side the redirection is performed by setting si.StartupInfo.hStdOutput and its friends to the correctly configured socket handles (non overlapping, blocking) so I'm not in control of the redirection there once CreateProcess has been called and was expecting it to work correctly.
I've got a problem: when redirected to socket handles, the output of Win32 programs is sometimes truncated (quite often, maybe 1 time / 5 launches). strace shows a clean behavior on the WSL side (outputs ends with a read()  = 0 from the socket connected to the Win32 redirection, but this is before the end of the expected data) while Process Monitor shows not enough writes from the Win32 side. ProcMon also sometimes captures really weird stuff when such errors occur, like nameless processes (not shown when it works) doing extra TCP accesses (maybe some WSL processes -- not tried to check yet) on affected sockets, but not always.
I'm seeing that problem with the following simple command BTW:
$ wcmd dir c:\\Windows\\System32 | cat

To summarize what happens: wcmd connects on <IP_ADDRESS>:$OUTBASH_PORT where outbash.exe listen, and send a command to launch "cmd /C dir c:\Windows\System32" with stdout redirected to a socket this instance of wcmd listens too. outbash.exe creates a non-overlapping Winsock socket and connect() it to the port indicated in the wcmd command, while wcmd accept() it. outbash.exe then CreateProcess "cmd /C dir c:\Windows\System32" with si.StartupInfo.hStdOutput = redirection_socket. wcmd read() all the data from the accepted socket, and write() it to stdout (in a loop). wcmd stops this forwarding loop when it receives read() = 0.
I've not yet tried to reproduce the situation using only Win32 processes, so I'm not even sure if the problem has anything to do with WSL or is more general to Windows (or if I made a stupid mistake), but I thought that maybe someone at MS with deep Win32 / Winsock / WSL sockets knowledge will have an idea?
Cheers!

@xilun - Pretty interesting project! As you have already noted, without actually being in control of both ends of the sockets, its difficult to say where things are going wrong. Given that there is some problem with truncation bytes and that it is intermittent, there could be some weirdness going on in terms of the last few bytes sent and the socket being closed immediately (see this relevant [post] (http://blog.csdn.net/CPP_CHEN/article/details/29864509)).
Something you can try and along the lines of what you have already noted:
Write a custom win32 program which you can launch using wcmd and that will give you control of tracking every byte that is sent. Since you already have control of the socket on the WSL side, you know exactly what is coming through there. Then using some diff and experimentation with socket options on the win32 side, you can see where the problem exists.
If you are using Windows redirection using 'StartupInfo.hStdOutput', I am guessing that the program doesn't know that it is a socket and then once the final byte is written, it just closes the handle (or socket) in this case.

@xilun - Pretty interesting project! As you have already noted, without actually being in control of both ends of the sockets, its difficult to say where things are going wrong. Given that there is some problem with truncation bytes and that it is intermittent, there could be some weirdness going on in terms of the last few bytes sent and the socket being closed immediately (see this relevant post).
As you have noted, being able to track exactly what is being sent and what is being received is one of the ways to get closer to and understanding of the problem. Maybe you can write a simple TCP send(win32)/recv(WSL) program and send some data and experiment with close/shutdown to see if you can get a repro.
If you are using Windows redirection using 'StartupInfo.hStdOutput', I am guessing that the program doesn't know that it is a socket and then once the final byte is written, it just closes the handle (or socket) in this case.

Thanks for the advice! I'll try that and also to use a Win32 client to see if the behavior differs.

I have carefully studied the blog post you linked and also on MSDN Graceful Shutdown, Linger Options, and Socket Closure, (closesocket function)[https://msdn.microsoft.com/en-us/library/windows/desktop/ms737582(v=vs.85).aspx] and I believe that the default lingering behavior should be "Graceful shutdown, immediate return" except if CloseHandle or the implicit closing of handle performed at process termination is not equivalent to closesocket(), but I believe it is (supposed to be) equivalent. This does not match the behavior I got.
Anyway I found an effective workaround for my use case even before trying to see if WSL is involved in this problem or if it is more general; if I keep the sockets handles open in outbash.exe after CreateProcess has been called and until the created process terminates, everything works as expected (for now I also call shutdown SD_BOTH in outbash.exe on said sockets, I'll check if this is needed given the advertised default linger behavior). This is perfectly OK for my application, so I'll just continue to do that and probably not dig too much further into the exact root cause of this issue.

I believe their is something seriously wrong that happens if the caller of CreateProcess with redirection of a standard handle to a socket closes the socket handle just after CreateProcess returns and before the created process terminates. When testing in a loop my old implementation which did that, I managed to hang the client (approx 1 / 5000 times) with the final syscalls like in the following:
[...]
18:14:51.278948 read(5, "07/05/2016  10:37             8\302"..., 16384) = 2229
18:14:51.278948 write(1, "07/05/2016  10:37             8\302"..., 2229) = 2229
18:14:51.278948 read(5, 0x6071e0, 16384) = -1 EAGAIN (Resource temporarily unavailable)
18:14:51.278948 select(6, [5], [], NULL, NULL) = 1 (in [5])
18:14:51.278948 read(5, "07/05/2016  10:35            48\302"..., 16384) = 2636
18:14:51.278948 write(1, "07/05/2016  10:35            48\302"..., 2636) = 2636
18:14:51.278948 read(5, "07/05/2016  10:35            31\302"..., 16384) = 10813
18:14:51.278948 write(1, "07/05/2016  10:35            31\302"..., 10813) = 10813
18:14:51.278948 read(5, "07/05/2016  10:36           740\302"..., 16384) = 7143
18:14:51.278948 write(1, "07/05/2016  10:36           740\302"..., 7143) = 7143
18:14:51.294567 read(5, "07/05/2016  10:37             7\302"..., 16384) = 8427
18:14:51.294567 write(1, "07/05/2016  10:37             7\302"..., 8427) = 8427
18:14:51.294567 read(5, "07/05/2016  10:34            87\302"..., 16384) = 3443
18:14:51.294567 write(1, "07/05/2016  10:34            87\302"..., 3443) = 3443
18:14:51.294567 read(5, "07/05/2016  10:35           257\302"..., 16384) = 16384
18:14:51.294567 write(1, "07/05/2016  10:35           257\302"..., 16384) = 16384
18:14:51.294567 read(5, "16  10:35            82\302\240944 MSc"..., 16384) = 16384
18:14:51.294567 write(1, "16  10:35            82\302\240944 MSc"..., 16384) = 16384
18:14:51.294567 read(5, "32.exe\r\n07/05/2016  10:36       "..., 16384) = 5847
18:14:51.294567 write(1, "32.exe\r\n07/05/2016  10:36       "..., 5847) = 5847
18:14:51.294567 read(5, "07/05/2016  10:35           227\302"..., 16384) = 16384
18:14:51.294567 write(1, "07/05/2016  10:35           227\302"..., 16384) = 16384
18:14:51.294567 read(5, "72 RpcRtRemote.dll\r\n", 16384) = 20
18:14:51.294567 write(1, "72 RpcRtRemote.dll\r\n", 20) = 20
18:14:51.294567 read(5, "07/05/2016  10:36           818\302"..., 16384) = 151
18:14:51.294567 write(1, "07/05/2016  10:36           818\302"..., 151) = 151
18:14:51.310242 read(5, "07/05/2016  10:37           128\302"..., 16384) = 11817
18:14:51.310242 write(1, "07/05/2016  10:37           128\302"..., 11817) = 11817
18:14:51.310242 read(5, "07/05/2016  15:07           503\302"..., 16384) = 14884
18:14:51.310242 write(1, "07/05/2016  15:07           503\302"..., 14884) = 14884
18:14:51.310242 read(5, "07/05/2016  10:34            42\302"..., 16384) = 2480
18:14:51.310242 write(1, "07/05/2016  10:34            42\302"..., 2480) = 2480
18:14:51.310242 read(5, "07/05/2016  10:37            67\302"..., 16384) = 220
18:14:51.310242 write(1, "07/05/2016  10:37            67\302"..., 220) = 220
18:14:51.310242 read(5, "07/05/2016  10:40               "..., 16384) = 1809
18:14:51.310242 write(1, "07/05/2016  10:40               "..., 1809) = 1809
18:14:51.310242 read(5, "07/05/2016  10:35           121\302"..., 16384) = 373
18:14:51.310242 write(1, "07/05/2016  10:35           121\302"..., 373) = 373
18:14:51.310242 read(5, "07/05/2016  10:37           516\302"..., 16384) = 293
18:14:51.310242 write(1, "07/05/2016  10:37           516\302"..., 293) = 293
18:14:51.310242 read(5, "07/05/2016  10:37           321\302"..., 16384) = 317
18:14:51.310242 write(1, "07/05/2016  10:37           321\302"..., 317) = 317
18:14:51.310242 read(5, "\r\n07/05/2016  10:42            8"..., 16384) = 251
18:14:51.310242 write(1, "\r\n07/05/2016  10:42            8"..., 251) = 251
18:14:51.310242 read(5, "07/05/2016  10:35           386\302"..., 16384) = 251
18:14:51.310242 write(1, "07/05/2016  10:35           386\302"..., 251) = 251
18:14:51.310242 read(5, "\r\n07/05/2016  10:35           11"..., 16384) = 310
18:14:51.310242 write(1, "\r\n07/05/2016  10:35           11"..., 310) = 310
18:14:51.310242 read(5, "07/05/2016  10:36            33\302"..., 16384) = 234
18:14:51.310242 write(1, "07/05/2016  10:36            33\302"..., 234) = 234
18:14:51.310242 read(5, "07/05/2016  10:37         1\302\240022"..., 16384) = 303
18:14:51.310242 write(1, "07/05/2016  10:37         1\302\240022"..., 303) = 303
18:14:51.310242 read(5, "\r\n07/05/2016  10:37           52"..., 16384) = 10432
18:14:51.310242 write(1, "\r\n07/05/2016  10:37           52"..., 10432) = 10432
18:14:51.310242 read(5, "07/05/2016  10:35         3\302\240627"..., 16384) = 14743
18:14:51.325807 write(1, "07/05/2016  10:35         3\302\240627"..., 14743) = 14743
18:14:51.325807 read(5, "07/05/2016  10:35           819\302"..., 16384) = 3072
18:14:51.325807 write(1, "07/05/2016  10:35           819\302"..., 3072) = 3072
18:14:51.325807 read(5, 0x6071e0, 16384) = -1 EAGAIN (Resource temporarily unavailable)
18:14:51.325807 select(6, [5], [], NULL, NULL    <<    blocked here forever
After more than half an hour, while I was investigating and noted that the cmd process was long gone and so was the socket being selected on, my VM just blue screened. I previously got twice in the same situation (without the blue screen) and could kill the WSL client process (it seemed to be properly killed at the time). I had no time to try to kill it the last time because of the blue screen.

For reference, for testing I was running the following loop with cbwin outbash rev 5dc7a4b on insider build 14342:
$ i=0; while true ; do strace -tt -o trace.$i wcmd dir c:\windows\system32 | wc; i=$((i+1)) ; done | tee result.bad
I can send you the system crash dump if you want and tell me how to do.

I'm not sure that the blue screen is related to socket issues after all. I've been able to reproduce the "same" (SYSTEM_SERVICE_EXCEPTION in win32kfull.sys) blue screen with my new code under very heavy load, while also launching some sysinternals tools at the same time -- (however I did launch the old code a few time earlier in the same session). I have both memory.dmp files available if anybody at MS is interested.

@xilun - I am glad that you were able to find a workaround for your original problem. Regarding the hang in the client, is that something that is more easily reproducible through some test apps? Lastly, regarding the bugcheck in win32kfull.sys (just fyi that that component is outside of WSL), we would love to get the dump and pass it on to the right team. But, unfortunately, we don't have any out-of-band ways for people to upload dumps to. If there is a place where you can upload and share the dump, that will work. But, we do collect some telemetry from the bugchecks through Watson, and so it does make it to us in some way, but it is not like looking at a full dump.

I'll try to put the dump somewhere, I keep you in touch.
I'll also try to reduce the WSL socket hang on select bug to a simple test.

The 2 dumps are in https://www.sceen.net/~xilun/MEMORY.0.DMP and https://www.sceen.net/~xilun/MEMORY.1.DMP
Please tell me when you got them so I can remove them.

I have downloaded the dumps, feel free to remove them. Thanks for sharing them.

The owners of win32kfull informed that this is a known regression which has been fixed. It might not have made it to the release branch yet.

Ok thanks for the info. Any idea what triggers it so I can try to avoid that?

@xilun - The feature team is not exactly sure what scenario triggers the bug, but "having multiple displays connected with different DPI scaling selected can temporarily mitigate the issue".

Closing this issue as this maybe was not WSL specific, and/or maybe has been fixed (did not try to repro recently) + I've got a workaround (don't half close sockets) for the most annoying part of the problems.


Bug: If the project is generated while passing configuration-affecting flags, generated files will fail

Describe the bug
If you generate a project while passing configuration-affecting flags that result in a different configuration than not passing those flags, e.g.:
bazel run --ios_multi_cpus=x86_64 //:xcodeproj

then the Bazel Generated Files target will generate files for the wrong configuration(s). Then the subsequent Copy Files script will fail to find the files.
Expected behavior
You should be able to define configuration for the project.
Versions

rules_xcodeproj: 0.1.0

Additional Context
A current workaround is setting values in .bazelrc that will be applied without configs, to both the project generation and the internal generate files bazel call.

This would be nice to have, one obvious issue I've run into is having to build multi platform projects. i.e. using Bazel to build iOS apps and a macOS CLI.
I've solved this using build_setting which means I can do something like bazel build --config=macos //MyTarget via the command line but I'm not entirely sure how this translates to an Xcode project using BwB.
Some way of either having the rules transition on configuration flags or having the rule allow for defining a set of flags would be great.

Sadly transitions can't apply --config. But yes, that's the goal of the 0.8 Milestone.


Maximum execution time error

Implementing this on windows , every dependencies installed now getting this issue
"Maximum execution time of 30 seconds exceeded in pdf-to-html\src\Base.php"  i got below file object  :
Gufy\PdfToHtml\Pdf Object ( [file:protected] => ./uploads/2/2.pdf [info:protected] => )
it is showing me protected,is that ok?
why this error , any clue?

I set maximum execution time to ini_set('max_execution_time', 14000);
But i doubt if it is the correct way of handling this issue.


Bug in the line items list when editing a line item

Description
While editing a line item we are getting the date of it(already added line item) in the new line items list.
What is the expected behavior?
The date of entry which is in edit mode should not be visible on the new items list
What is the current behavior?
While editing a line item we are getting the date of it(already added line item) in the new line items list.
How to reproduce the issue?

Go to invoices and click on new Invoice
Select a Client (E.g. Flipkart or Microsoft)
Click on the new line item button and  add an entry
On the added entry click on the three dots menu icon and click Edit entry
Now click on the new line item button again and we can see the date of entry(of step 4) is visible in the list

Screenshots or Screencast
Loom: https://www.loom.com/share/fc94274fdb4c4369a07458405304a2ad

@apoorv1316 Can you please assign this to me. I would like to work on this

Sure assigned it to you @rajat-tomar

Hey @apoorv1316 just raised the PR for the issue. Please check PR#737

Thanks @rajat-tomar for contributing to miru


User configuration still not always saved

[Related to Issue #231]
The problem addressed in issue #231 is indeed better but is still not fully fixed.
Here's an example case video depicting what happens to me about 10% of the time - Last state not always saved.
The video shows one case, but it happens in other ways as well, causing the last state to be lost and a different file to be displayed on the next session.

Verified fixed; at least, I have not seen this happen again, yet.


make dimension.py xarray compatible

Converted the methods in dimension.py to work with the new xarray datamodel. Since these methods can largely be replaced by xarray functionality, I updated these methods to make use of this.

@dnerini I have added a ticket to the project backlog, for a basic input validator with a decorator.

@dnerini I believe I have also taken care of the remaining comments you had, let me know what you think


Add a plugin entry within the menu page + page

I suggest to add a plugin entry within the menu page + page presenting the following info as a table

Name
Description
Protocol
Service Type
Doc Link

Basic authentication
Basic HTTP authentication where account is verified using LDAP, JDBC or static list
HTTP(S)
REST, Web Service
REST or Web Service

Where would this table live?

Should be under this project (web site)

Right, but there are a lot of different pages.  Are you suggesting a new "Apiman Policies" page, or perhaps something in the User Guide?  Just curious.

As the policies (and also the plugins) are important key concepts of the Apiman technology, they should be part of a dedicated web site page that why not, we can add as addendum to the user guide manual


Particlesjs refresh method (for React)

Hi,
I'm using particle.js as background on a React project with Routes. When I "change page" on the website, this is pratticaly the DOM content which changes, and so the height of the page changes too depending of the elements which are loaded at this moment in the app container.
However, the particles canvas isn't self-adapative. So I needed to create a function (based on https://github.com/VincentGarreau/particles.js/issues/86). Here's the "bad way" I used to fix my problem :
function particlesReload(){
    if(pJSDom[0]){
        cancelRequestAnimFrame(pJSDom[0].pJS.fn.checkAnimFrame);
        cancelRequestAnimFrame(pJSDom[0].pJS.fn.drawAnimFrame);
        pJSDom[0].pJS.tmp.source_svg = undefined;
        pJSDom[0].pJS.tmp.img_obj = undefined;
        pJSDom[0].pJS.tmp.count_svg = 0;
       // Resize the canvas
        pJSDom[0].pJS.canvas.el.width = window.innerWidth;
        pJSDom[0].pJS.canvas.el.height = window.innerHeight;
        pJSDom[0].pJS.fn.particlesEmpty();
        pJSDom[0].pJS.fn.canvasClear();
        pJSDom[0].pJS.fn.vendors.start();
    }
};

It should be usefull to have a kind of "refresh" method nativally in the lib.
If it exists, I didn't find one. Can you please enlightened me on the subject ?

react-particle-animation may be easier for you to work with 😄


The Info of PLYR PHI mainnet on thirdweb chain list not correct

Ref to the testnet: https://github.com/thirdweb-dev/js/issues/3047
We have a problem like this before. and you guys solved this problem.
Now, we already released a mainnet and the problem occured again. Please fix this problem
https://thirdweb.com/plyr-phi

icon : ipfs://QmVhG7xeTc78ibQunQ5sBJ4533r9FDM2xUCQKV72DPd1ux
from ethereum-list -> https://github.com/ethereum-lists/chains/blob/master/_data/icons/plyr.json
and info is : https://plyr.network/ not avacloud.io

updated, caches will clear over the next couple of minutes to an hour and it should be fixed


[Bug]: page.pdf produces corrupt pdf

Bug description
Steps to reproduce the problem:
Occasionally, we find that our PDFs are not openable by any programs.  We've narrowed the issue down to inclusion of certain images.  When these images are present, the pdf created by puppeteer is corrupt.  All image tools do not indicate that anything is wrong with the image itself so I believe this is an issue on the puppeteer side.

Create an test.html file with the following contents

<html>
  <head>
  </head>
  <body>
    <img src="image.jpg">
  </body>
</html>

In the same directory, place the attached image.jpg

Create a save_to_pdf.js file with the following contents

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({ headless: true });
  const page = await browser.newPage();
  await page.goto(`file://${__dirname}/test.html`, { waitUntil: 'networkidle0', timeout: 60000 });
  await page.pdf({
    path: 'out.pdf',
    printBackground: true
  });

  await browser.close();
})();

Run node save_to_pdf.js
Try to open out.pdf in any program.

puppeteer_bug.zip
image.jpg
Puppeteer version
10.1.0
Node.js version
12.22.5
npm version
6.14.14
What operating system are you seeing the problem on?
macOS
Relevant log output
No response

I'm tracking a very similar issue with headless page pdf() calls creating corrupted files with certain input images, which started after puppeteer 10.0.0, and have been working on a way to reproduce it. I've been assuming it was the version of Chrome that was to blame somehow.... but both 10.0.0 and 10.1.0 reference Chrome 884014.
There's not a ton of delta between puppeteer 10.0.0 and 10.1.0, but the answer is in there somewhere.
I've recently created a testbed (https://github.com/MartinFalatic/puppeteer-explorations) that I used to replicate the issue. I was able to replicate the failure with your jpg as well as (separately) my own problematic jpg.
So far there's no obvious reason - I also ran both images through http://exif.regex.info/ and got nothing obvious, except that my other assumptions - that the problem was EXIF metadata or maybe the colorspace or some quirk of JPEG vs JPG was possibly to blame - seem very much less likely now.

@MartinFalatic Thanks for the info! I was able to step through the commits and found that this was the cause
https://github.com/puppeteer/puppeteer/commit/e3699e248bc9c1f7a6ead9a07d68ae8b65905443

The file that fails for me is only 70,361 bytes (it's a 300x225 image) so whatever is going on it's not about the size of the image itself (though I wonder if there's some edge condition at work here, like some exact multiple of bytes in the image data).
It's particularly vexing because it doesn't seem to cause a visible error other than truncating the PDF.

So, I did a bit of experimentation tonight...
In node_modules\puppeteer\lib\cjs\puppeteer\common\helper.js (from 10.1.0) within my Docker container (corresponding to https://github.com/puppeteer/puppeteer/blob/v10.1.0/src/common/helper.ts#L363) I wedged in the following line:
size = 16384*2;

I noticed that size is 16384 (aka highWaterMark as noted in https://nodejs.org/docs/latest-v16.x/api/stream.html#new-streamreadableoptions)
Without that line, things fail as usual for the two files I know to be problematic. With that tweak? The PDF generates normally.
This reinforces my suspicion that this not about content but about the specific size of the content, though I haven't yet dumped the streams to see what the boundary conditions are (however, both files are odd lengths, so they're not exact multiples of size in any obvious way. But there may be overhead...)
Knowing this problem was also in 13.0.0, I see that there's a bugfix in 13.0.1 that affects this area of the code - but it doesn't help with this problem:
https://github.com/puppeteer/puppeteer/commit/5b792de7a97611441777d1ac99cb95516301d7dc#diff-8a47ddda6f4b58ba812e57c7bbef53b97bd7297359e3f8c07bedd10e5baafb6e

One more bit of info for today - puppeteer does give Chrome a hint as to how much data it wants at https://github.com/puppeteer/puppeteer/blob/v10.1.0/src/common/helper.ts#L364, specifically:
const response = await client.send('IO.read', { handle, size });

This accesses the Chrome DevTools protocol and uses IO.read (https://chromedevtools.github.io/devtools-protocol/1-3/IO/#method-read) to request up to a specified number of bytes from it (16384 by default).
I'm starting to wonder if Chrome is prematurely breaking the stream here (for no good reason evidently). If no size is given to that call, it'll send quite a lot of data in one go (at least 2.5MB, probably a lot more), but that's not tenable (it should have some reasonable chunk limit).
A way to mitigate this would be to check for the proper end-of-file magic in the PDF, then retry with a different size value, but of course that's playing whack-a-mole with this problem. If that size value was a hint to Page.pdf() then one could perform this validation on the fly and retry with different parameters.

Yeah, this seems to indicate that it's a bug on the chrome size.
I do see that prior to that feature being added, size was not being passed to IO.read (see https://github.com/puppeteer/puppeteer/blob/v10.0.0/src/common/helper.ts#L329).  Maybe it's fine to just remove it until an issue is created and resolved on the chrome side

It's up to the devs. Even if it was massive (say 8 MB) it might make the problem space much smaller. Then again, it's not clear what Chrome isn't liking here either

It's not clear to me what benefit was sought in making the original changes that landed in 10.1.0 to use streaming for the PDFs.
According to the same Chrome devtools docs for Page.printToPDF (https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF) the IO.StreamHandle is still experimental in big bold letters. All of this is stemming from the use of that handle (which seems to be pretty flakey in certain cases when size is specified, and may well be flakey in other cases yet to be determined). At least your branch should clear up the present problem which is good!
If I can manage to get enough data on this, and it turns out to not be specific to Puppeteer, it would be worth filing a bug with the Chromium team.

I think that might fix it https://chromium-review.googlesource.com/c/chromium/src/+/3413074

I think that might fix it https://chromium-review.googlesource.com/c/chromium/src/+/3413074

That looks promising, though it also looks like it's a long way from being in a release we can use.

https://github.com/puppeteer/puppeteer/pull/7868 won't actually fix the problem, it will just move the bug to the 10MB boundary which makes it less likely to happen (because fewer files are bigger than that). We can still land the fix until the Chromium fix arrives.

So the Chromium fix landed in M100 and I plan to create new Puppeteer release early next week.

The Chromium 100 is already part of the puppeteer. Do you have any ETA on when this ticket will be handled and #7868 will be reverted?

Interesting, given that Chrome 100 is still in beta. When is that going to be on stable/main?
http://dl.google.com/linux/chrome/deb stable/main amd64 google-chrome-stable amd64 99.0.4844.74-1

See https://chromiumdash.appspot.com/schedule

I had no idea that page existed - thanks!

The fix for the original issue was reverted for a couple of months now, but I don't see it in any recent release and the ticket itself is still in the "Open" state. Would you mind clarifying when this will be part of a release?

I believe this is fixed now.


Add stroke modifiers

Add stroke_cap(), stroke_weight(), and stroke_join().

You also need to do a git pull --rebase upstream master on that branch so that the CI passes


fix(logic): fixed refresh callback execution waiting

Added async function instead base in refresh api callback
Related Issues

Types of changes

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] I have read the CONTRIBUTING document.
[ ] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[ ] I have added tests to cover my changes.
[ ] All new and existing tests passed.

Description

Screenshots/Recordings

Added tests?

[ ] Yes
[ ] No, because they aren't needed

Added to documentation?

[ ] README
[ ] Documentation
[ ] No Documentation Needed

Hi, @vlev322 I released it on beta. Now we have to test it. If you already have a script. Please test it, and let me know the results.
If you don't have a script, lat me know that too. In that case I'll test it by my self.


BMI calculator

Describe the Feature you want to end

I wpuld like to add the feature involves "inches" in the input box which helps in better way to get results
Expected behavior

I believe this way we can handle the BMI calculator both ways and increases usage.
Screenshots (optional)

Additional context (optional )

I'm experienced in web development and would like to complete this task. Please assign this to me.

I would like to contribute

Hi I'm GSSoC'23 Contributor pls assign this issue to me.

Project already available


Kong 2.1.4 to 2.3.3 migration certificates resources breaking behavior

Summary
Was testing my Stage database data cloned into our dev region to see how the migrations of it would go, seems the certificates resource which has certs with newlines in the db had whatever migrations logic ran against it strip out all the \ of the \n's causing further processing of the certs to be invalid later and messing up any kinda API backend validating Kong with MTLS due to these invalid client certs.
Pre migration public cert resource data(Kong 2.1.4), can see the newlines distinctly in the db:

Post migration public cert resource data(Kong 2.3.3):

You can see how the slashes have been dropped and n chars are left. The same holds true for the private key field as well but for obvious reasons left that out of my screenshot.
Ideally Kong does not alter these things, was the parsing/handling changed somehow or new kinda sanitizing applied to the fields.. hmm.
Oddly I think the 2.1.4 to 2.3.2 migration I practiced on our dev database records did not show this behavior. It seems the newlines were respected but due to the various ways I tested, and the original state of the dev certs unchecked before migration I can't say this with 100% degree of certainty. Just was calling it out as something I checked about our upgraded dev table and still seeing newlines in place.
Noting same would happen with certs stored with windows newline formats like \r\n  , or \r in old mac os before X.  So it would be stripped and be rn's and r's
Steps To Reproduce

Store your certificate resource into db w newlines and such which creates clean formatting in many UI apps like Konga UI to view your cert, Kong 2.1.4.
Migrate your DB to Kong 2.3.3
Check DB content of your certificate resources.
They been bamboozled.

Additional Details & Logs

Kong version 2.3.3

@jeremyjpj0916 we don't have any migrations that deal with certificates between those versions. Are you sure it is not somekind of client issue? Is this cql output?

we only do:
      ALTER TABLE certificates ADD cert_alt TEXT;
      ALTER TABLE certificates ADD key_alt TEXT;

And if by that the data is changed, I would think it is a Cassandra issue.

I tried this by:

loaded 2.1.4
uploaded cert with new lines
checked db that it contains new lines
switched to 2.3.3
ran migrations up
ran migrations finish
checked db with cqlsh
checked response of certificates endpoint

So with this try, I could not reproduce it.

@bungle I had time to come back to this.
I found the issue, seems our ansible scripting that clones keyspace data around from various environments to other keyspaces/cassandra clusters is actually doing the slash stripping and causing the issue.
So good news is its not Kong, sorry I got tied up and didn't get time to investigate this further to recognize its not part of the migrations. Closing this issue!


HTTP/2 seems to only send one at a time

Seems to always fail on the second message, and have to disconnect and start again.
Here's the log:
INFO: Trying to initialize HTTP/2 backend...
INFO: Initialized HTTP/2 backend.
INFO: Sending messages queue, run #1: 5 message(s) left in queue.
STATUS: Sending message ID 1 [custom identifier: 519] (1/3): 125 bytes.
STATUS: Sending message ID 2 [custom identifier: f7e] (1/3): 125 bytes.
ERROR: Unable to send message ID 2:  (0).
INFO: Disconnected.
INFO: Trying to initialize HTTP/2 backend...
INFO: Initialized HTTP/2 backend.
INFO: Sending messages queue, run #2: 4 message(s) left in queue.
INFO: Message ID 2 [custom identifier: f7e] has no error (0), removing from queue...
STATUS: Sending message ID 3 [custom identifier: b5d] (1/3): 125 bytes.
STATUS: Sending message ID 4 [custom identifier: d9d] (1/3): 125 bytes.
ERROR: Unable to send message ID 4:  (0).
INFO: Disconnected.
INFO: Trying to initialize HTTP/2 backend...
INFO: Initialized HTTP/2 backend.
INFO: Sending messages queue, run #3: 2 message(s) left in queue.
INFO: Message ID 4 [custom identifier: d9d] has no error (0), removing from queue...
STATUS: Sending message ID 5 [custom identifier: 39c] (1/3): 125 bytes.
INFO: Disconnected.

We're seeing this too, it's bad performance.
Any ideas what can be done?


Use native prepared statements from trino-python-client

Overview
Remove prepared statements emulation from dbt-trino and rely on the prepared statements support of native python types from trino-python-client

Description:
Related issue(s):
Related code pull request(s):
Related link(s): Improved python types from trino-python-client, #28

Checklist

[x] This PR includes tests, or tests are not required/relevant for this PR
[x] README.md updated and added information about my change
[x] CHANGELOG.md updated and added information about my change

nit: Please use a capital letter in the first word of the commit message:

upgrade trino-python-client -> Upgrade trino-python-client
align pytz with trino-python-client -> Align pytz with trino-python-client

I've also tested the source freshness feature
❯ dbt source freshness
07:56:04  Running with dbt=1.0.3
07:56:04  Unable to do partial parsing because profile has changed
07:56:05  Found 19 models, 14 tests, 0 snapshots, 0 analyses, 375 macros, 0 operations, 5 seed files, 13 sources, 0 exposures, 0 metrics
07:56:05
07:56:05  Concurrency: 8 threads (target='trino')
07:56:05
07:56:05  1 of 1 START freshness of replica_dwh_screenings.rd_dag......................... [RUN]
07:56:06  1 of 1 PASS freshness of replica_dwh_screenings.rd_dag.......................... [PASS in 0.85s]
07:56:06  Done.
❯ dbt source freshness
07:56:27  Running with dbt=1.0.3
07:56:27  Found 19 models, 14 tests, 0 snapshots, 0 analyses, 375 macros, 0 operations, 5 seed files, 13 sources, 0 exposures, 0 metrics
07:56:27
07:56:27  Concurrency: 8 threads (target='trino')
07:56:27
07:56:27  1 of 1 START freshness of replica_dwh_screenings.rd_dag......................... [RUN]
07:56:28  1 of 1 ERROR STALE freshness of replica_dwh_screenings.rd_dag................... [ERROR STALE in 0.57s]
07:56:28

@mdesmet please consider shrinking this PR / spin-off part of it in another PR to enable the source freshness functionality and leave the controversial discussion around the line too long for dbt seed aside.

@mdesmet please consider shrinking this PR / spin-off part of it in another PR to enable the source freshness functionality and leave the controversial discussion around the line too long for dbt seed aside.

As discussed I've added a new flag, also documented in the README.

I made use of the new test framework to add some integration tests. I also added a trino_connection fixture to be able to directly query data on Trino if necessary. Used here to detect if the dbt seed execution used prepared statements or not.