小编use*_*821的帖子

打字稿模块解析

是否有一个打字稿模块解析策略,允许我让本地导入不是以斜杠开头,而是从同一模块中的node_modules导入?

将"moduleResolution"设置为"node"时,编译器找不到我的本地模块,所有其他选项都没有看到我正在尝试导入的node_modules目录中的模块.

我的文件中有以下导入:

import {Injectable} from "angular2/core";
import {Logger} from "core/logging/Logger";
Run Code Online (Sandbox Code Playgroud)

"angular2/core"位于node_modules中,"core/logging/Logger"是我的本地模块.

我认为这应该是可能的,如果你看看角度的代码,他们似乎有两个,即.在http.ts模块中:https: //github.com/angular/angular/blob/master/modules/angular2/src/http/http.ts

import {Injectable} from 'angular2/core'; //this is local
import {Observable} from 'rxjs/Observable'; //this probably comes from node_modules
Run Code Online (Sandbox Code Playgroud)

更多背景信息:
我有一个由两个子项目组成的项目:
- library
- app
Library定义了一些应用程序随后使用的实用程序.我的构建过程首先构建'library'子项目,然后将它(与d.ts文件一起编译的js)复制到'app的node_modules中的'library'子文件夹,然后编译'app'.

在'library'中我有以下类:

//file project/library/jsonparser/JSONParser.ts
class JSONParser {...} 

//file project/library/services/ConfigurationService.ts
import {JSONParser} from "../jsonparser/JSONParser"
class ConfigurationService {
  constructor(parser: JSONParser){ ... }
}
Run Code Online (Sandbox Code Playgroud)

在'app'中:

import {JSONParser} from "library/jsonparser/JSONParser" //this comes from node_modules in 'app'
import {ConfigurationService} from "library/services/ConfigurationService" //from node_modules
class AppConfigurationService …
Run Code Online (Sandbox Code Playgroud)

node-modules typescript tsconfig

6
推荐指数
1
解决办法
3875
查看次数

在VS Code中调试haskell

我正在尝试使用phoityne-vscode插件在VS Code中调试一个简单的Haskell应用程序。我设法配置了插件并运行了应用程序-我可以看到断点。

问题是无法弄清楚如何与正在运行的应用程序进行交互。我在一行中希望有用户输入

do
  someValue <- getLine
Run Code Online (Sandbox Code Playgroud)

调试器到达此行后,它将停止,并且我无法弄清楚如何将参数传递给程序。我猜想它在调试控制台中的某个位置,但看起来提示仅用于驱动调试器。

我确信我缺少一些非常简单的东西-这是我第一次尝试使用Haskell进行调音,而且我还是VS Code的新手。

haskell visual-studio-code

5
推荐指数
1
解决办法
1206
查看次数