mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-11 12:59:17 +03:00
Fix VSCode extension and remove silly warnings (#2042)
This commit is contained in:
parent
b6daa2defa
commit
4f55cb3bda
@ -178,6 +178,8 @@ jobs:
|
|||||||
git checkout $GITHUB
|
git checkout $GITHUB
|
||||||
cd compiler/daml-extension
|
cd compiler/daml-extension
|
||||||
yarn
|
yarn
|
||||||
|
# This produces out/src/extension.js
|
||||||
|
yarn run compile
|
||||||
vsce publish ${GITHUB#v} -p $MARKETPLACE_TOKEN
|
vsce publish ${GITHUB#v} -p $MARKETPLACE_TOKEN
|
||||||
else
|
else
|
||||||
if [[ "${GITHUB#v}" == "$MARKET" ]]; then
|
if [[ "${GITHUB#v}" == "$MARKET" ]]; then
|
||||||
|
@ -55,7 +55,7 @@ setHandlersVirtualResource = PartialHandlers $ \WithMessage{..} x -> return x
|
|||||||
{LSP.didOpenTextDocumentNotificationHandler = withNotification (LSP.didOpenTextDocumentNotificationHandler x) $
|
{LSP.didOpenTextDocumentNotificationHandler = withNotification (LSP.didOpenTextDocumentNotificationHandler x) $
|
||||||
\_ ide (DidOpenTextDocumentParams TextDocumentItem{_uri}) ->
|
\_ ide (DidOpenTextDocumentParams TextDocumentItem{_uri}) ->
|
||||||
withUriDaml _uri $ \vr -> do
|
withUriDaml _uri $ \vr -> do
|
||||||
logInfo (ideLogger ide) $ "Opened virtual resource NEIL: " <> textShow vr
|
logInfo (ideLogger ide) $ "Opened virtual resource: " <> textShow vr
|
||||||
modifyOpenVirtualResources ide (S.insert vr)
|
modifyOpenVirtualResources ide (S.insert vr)
|
||||||
|
|
||||||
,LSP.didCloseTextDocumentNotificationHandler = withNotification (LSP.didCloseTextDocumentNotificationHandler x) $
|
,LSP.didCloseTextDocumentNotificationHandler = withNotification (LSP.didCloseTextDocumentNotificationHandler x) $
|
||||||
|
@ -18,25 +18,24 @@ import Development.IDE.Types.Logger
|
|||||||
import Development.IDE.Core.Service
|
import Development.IDE.Core.Service
|
||||||
import Development.IDE.Types.Location
|
import Development.IDE.Types.Location
|
||||||
|
|
||||||
|
import Control.Monad.Extra
|
||||||
import qualified Data.Set as S
|
import qualified Data.Set as S
|
||||||
|
|
||||||
import Development.IDE.Core.FileStore
|
import Development.IDE.Core.FileStore
|
||||||
import Development.IDE.Core.OfInterest
|
import Development.IDE.Core.OfInterest
|
||||||
|
|
||||||
|
|
||||||
whenUriFile :: IdeState -> Uri -> (NormalizedFilePath -> IO ()) -> IO ()
|
whenUriFile :: Uri -> (NormalizedFilePath -> IO ()) -> IO ()
|
||||||
whenUriFile ide uri act = case LSP.uriToFilePath uri of
|
whenUriFile uri act = whenJust (LSP.uriToFilePath uri) $ act . toNormalizedFilePath
|
||||||
Just file -> act $ toNormalizedFilePath file
|
|
||||||
Nothing -> logWarning (ideLogger ide) $ "Unknown scheme in URI: " <> getUri uri
|
|
||||||
|
|
||||||
setHandlersNotifications :: PartialHandlers
|
setHandlersNotifications :: PartialHandlers
|
||||||
setHandlersNotifications = PartialHandlers $ \WithMessage{..} x -> return x
|
setHandlersNotifications = PartialHandlers $ \WithMessage{..} x -> return x
|
||||||
{LSP.didOpenTextDocumentNotificationHandler = withNotification (LSP.didOpenTextDocumentNotificationHandler x) $
|
{LSP.didOpenTextDocumentNotificationHandler = withNotification (LSP.didOpenTextDocumentNotificationHandler x) $
|
||||||
\_ ide (DidOpenTextDocumentParams TextDocumentItem{_uri}) -> do
|
\_ ide (DidOpenTextDocumentParams TextDocumentItem{_uri}) -> do
|
||||||
setSomethingModified ide
|
setSomethingModified ide
|
||||||
whenUriFile ide _uri $ \file ->
|
whenUriFile _uri $ \file -> do
|
||||||
modifyFilesOfInterest ide (S.insert file)
|
modifyFilesOfInterest ide (S.insert file)
|
||||||
logInfo (ideLogger ide) $ "Opened text document: " <> getUri _uri
|
logInfo (ideLogger ide) $ "Opened text document: " <> getUri _uri
|
||||||
|
|
||||||
,LSP.didChangeTextDocumentNotificationHandler = withNotification (LSP.didChangeTextDocumentNotificationHandler x) $
|
,LSP.didChangeTextDocumentNotificationHandler = withNotification (LSP.didChangeTextDocumentNotificationHandler x) $
|
||||||
\_ ide (DidChangeTextDocumentParams VersionedTextDocumentIdentifier{_uri} _) -> do
|
\_ ide (DidChangeTextDocumentParams VersionedTextDocumentIdentifier{_uri} _) -> do
|
||||||
@ -51,7 +50,7 @@ setHandlersNotifications = PartialHandlers $ \WithMessage{..} x -> return x
|
|||||||
,LSP.didCloseTextDocumentNotificationHandler = withNotification (LSP.didCloseTextDocumentNotificationHandler x) $
|
,LSP.didCloseTextDocumentNotificationHandler = withNotification (LSP.didCloseTextDocumentNotificationHandler x) $
|
||||||
\_ ide (DidCloseTextDocumentParams TextDocumentIdentifier{_uri}) -> do
|
\_ ide (DidCloseTextDocumentParams TextDocumentIdentifier{_uri}) -> do
|
||||||
setSomethingModified ide
|
setSomethingModified ide
|
||||||
whenUriFile ide _uri $ \file ->
|
whenUriFile _uri $ \file -> do
|
||||||
modifyFilesOfInterest ide (S.delete file)
|
modifyFilesOfInterest ide (S.delete file)
|
||||||
logInfo (ideLogger ide) $ "Closed text document: " <> getUri _uri
|
logInfo (ideLogger ide) $ "Closed text document: " <> getUri _uri
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user